Skip to content

Commit

Permalink
Added strict-boolean-expression rule and fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prestoncraw committed Mar 12, 2024
1 parent ad0b52d commit ffb39ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
21 changes: 17 additions & 4 deletions common-pages/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
Expand All @@ -13,6 +11,21 @@
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/ban-types": "warn",
"prefer-const": "warn"
"prefer-const": "warn",
"@typescript-eslint/strict-boolean-expressions": ["error", {
"allowString": false,
"allowNumber": false,
"allowNullableObject": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowNullableEnum" : false,
"allowAny": false,
"allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing": false
}]
},
"ignorePatterns": ["package/**/*", "__tests__", "lib"],
"parserOptions" : {
"project": ["./tsconfig.json"]
}
}
2 changes: 1 addition & 1 deletion common-pages/src/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function Setting(props: IProps) {
dispatch(props.SettingsSlice.DBAction({verb: 'POST', record: editnewSetting}))
if (conf && editNew === 'Edit')
dispatch(props.SettingsSlice.DBAction({verb: 'PATCH', record: editnewSetting}))
if (!conf && isBtn)
if (!conf && (isBtn ?? false))
setShowWarning(true);
setShowModal(false);
}}
Expand Down
4 changes: 2 additions & 2 deletions common-pages/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"outDir": "./lib",
"strict": true,
"jsx": "react",
"skipLibCheck": true

"skipLibCheck": true,
"strictNullChecks": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
Expand Down
3 changes: 2 additions & 1 deletion react-table/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"outDir": "./lib",
"strict": true,
"jsx": "react",
"skipLibCheck": true
"skipLibCheck": true,
"strictNullChecks": true
},
"include": ["src"],
"exclude": ["node_modules", "**/__tests__/*"]
Expand Down

0 comments on commit ffb39ff

Please sign in to comment.