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:
@@ -44,7 +44,9 @@ export function fieldReducer(state: FormState, action: FieldAction): FormState {
|
||||
|
||||
case 'REMOVE': {
|
||||
const newState = { ...state }
|
||||
if (newState[action.path]) delete newState[action.path]
|
||||
if (newState[action.path]) {
|
||||
delete newState[action.path]
|
||||
}
|
||||
return newState
|
||||
}
|
||||
|
||||
@@ -251,7 +253,9 @@ export function fieldReducer(state: FormState, action: FieldAction): FormState {
|
||||
const rowsMetadata = [...(state[path].rows || [])]
|
||||
|
||||
const duplicateRowMetadata = deepCopyObjectSimple(rowsMetadata[rowIndex])
|
||||
if (duplicateRowMetadata.id) duplicateRowMetadata.id = new ObjectId().toHexString()
|
||||
if (duplicateRowMetadata.id) {
|
||||
duplicateRowMetadata.id = new ObjectId().toHexString()
|
||||
}
|
||||
|
||||
const duplicateRowState = deepCopyObject(rows[rowIndex])
|
||||
if (duplicateRowState.id) {
|
||||
|
||||
Reference in New Issue
Block a user