Skip to content

Commit

Permalink
Add ESLint rule for flagging use of "null" (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyonsil authored Dec 6, 2023
2 parents dfdb3b7 + 4cf87b2 commit 70bed53
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module.exports = {
],
// Should use our logger anytime you want logs that persist. Otherwise use console only in testing
'no-console': 'warn',
'no-null/no-null': 2,
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'prettier/prettier': ['warn', { tabWidth: 2, trailingComma: 'all' }],
'react/jsx-indent-props': ['warn', 2],
Expand Down Expand Up @@ -109,7 +110,7 @@ module.exports = {
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'no-null'],
settings: {
'import/resolver': {
typescript: {
Expand Down
37 changes: 35 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down

0 comments on commit 70bed53

Please sign in to comment.