chore(eslint): curly [skip-lint] (#7959)

Now enforcing curly brackets on all if statements. Includes auto-fixer.


```ts
//  Bad
if (foo) foo++;

//  Good
if (foo) {
  foo++;
}
```




Note: this did not lint the `drizzle` package or any `db-*` packages.
This will be done in the future.
This commit is contained in:
Elliot DeNolf
2024-08-29 10:15:36 -04:00
committed by GitHub
parent dd3d985091
commit 142616e6ad
267 changed files with 1681 additions and 611 deletions

View File

@@ -17,21 +17,21 @@
align-items: center;
width: 100%;
}
&__locationText {
font-variant-numeric: tabular-nums;
margin: 0;
}
&__controls {
display: flex;
gap: calc(var(--base) / 2);
.btn {
background-color: var(--theme-elevation-100);
width: calc(var(--base) * 1.2);
height: calc(var(--base) * 1.2);
&:hover {
background-color: var(--theme-elevation-200);
}

View File

@@ -30,8 +30,11 @@ export function ActionsBar() {
buttonStyle="none"
onClick={() => {
const nextIndex = activeIndex - 1
if (nextIndex < 0) setActiveIndex(forms.length - 1)
else setActiveIndex(nextIndex)
if (nextIndex < 0) {
setActiveIndex(forms.length - 1)
} else {
setActiveIndex(nextIndex)
}
}}
type="button"
>
@@ -42,8 +45,11 @@ export function ActionsBar() {
buttonStyle="none"
onClick={() => {
const nextIndex = activeIndex + 1
if (nextIndex === forms.length) setActiveIndex(0)
else setActiveIndex(nextIndex)
if (nextIndex === forms.length) {
setActiveIndex(0)
} else {
setActiveIndex(nextIndex)
}
}}
type="button"
>

View File

@@ -7,7 +7,7 @@
height: 100%;
padding: calc(var(--base) * 2) var(--gutter-h);
}
.dropzone {
flex-direction: column;
justify-content: center;

View File

@@ -197,14 +197,18 @@ function ReportAllErrors() {
const reportFormErrorCount = React.useCallback(
(errorCount) => {
if (errorCount === errorCountRef.current) return
if (errorCount === errorCountRef.current) {
return
}
setFormTotalErrorCount({ errorCount, index: activeIndex })
errorCountRef.current = errorCount
},
[activeIndex, setFormTotalErrorCount],
)
if (!docConfig) return null
if (!docConfig) {
return null
}
return <WatchChildErrors fields={docConfig.fields} path="" setErrorCount={reportFormErrorCount} />
}

View File

@@ -58,7 +58,7 @@
border-radius: var(--style-radius-m);
}
}
&__fileRowContainer {
--rowPadding: calc(var(--base) / 4);
position: relative;
@@ -210,9 +210,8 @@
height: 100%;
opacity: 0;
transition: opacity 100ms cubic-bezier(0, 0.2, 0.2, 1);
}
&__showingFiles {
.file-selections__mobileBlur {
opacity: 1;
@@ -230,11 +229,11 @@
&__showingFiles {
z-index: 2;
}
&__filesContainer {
@include blur-bg;
}
&__fileRowContainer {
z-index: 1;
}
@@ -242,7 +241,7 @@
&__header {
margin-top: 0;
}
&__headerTopRow {
border-top: 1px solid var(--theme-border-color);
padding-block: calc(var(--base) * 0.8);
@@ -255,17 +254,17 @@
padding-block: calc(var(--base) * 0.8);
padding-inline: var(--file-gutter-h);
border-top: 1px solid var(--theme-border-color);
> div {
display: flex;
justify-content: flex-end;
width: 100%;
button {
flex: .5;
flex: 0.5;
}
}
}
&__toggler {
padding-right: 0;
display: block;
@@ -275,5 +274,4 @@
margin: 0;
}
}
}

View File

@@ -327,7 +327,9 @@ export function FormsManagerProvider({ children }: FormsManagerProps) {
)
React.useEffect(() => {
if (!collectionSlug) return
if (!collectionSlug) {
return
}
if (!hasInitializedState) {
void initializeSharedFormState()
}

View File

@@ -25,7 +25,9 @@ function DrawerContent() {
[addFiles],
)
if (!collectionSlug) return null
if (!collectionSlug) {
return null
}
if (!forms.length && !isInitializing) {
return <AddFilesView onCancel={() => closeModal(drawerSlug)} onDrop={onDrop} />