-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump ESLint and related dependencies (#2986)
* Bump lint-related dependencies * Migrate to ESLint flat config * Fix plugin errors Also updated ESLint yarn script. * Remove unused directive * Remove unused plugin for now * Deduplicate dependencies * Restore old lint behavior * Add TODO for future lint rules * Fix format, format script * Disable CRA's ESLint
- Loading branch information
1 parent
bb4628f
commit 2b6dbc3
Showing
8 changed files
with
879 additions
and
432 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// @ts-check | ||
|
||
// Todo: Use ES module | ||
const eslint = require('@eslint/js'); | ||
const tseslint = require('typescript-eslint'); | ||
const reactRefresh = require('eslint-plugin-react-refresh'); | ||
|
||
const FlatCompat = require('@eslint/eslintrc').FlatCompat; | ||
const compat = new FlatCompat({ | ||
baseDirectory: `${__dirname}` | ||
}); | ||
|
||
module.exports = tseslint.config( | ||
{ ignores: ['eslint.config.js'] }, | ||
// eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
// TODO: Enable when ready | ||
// { | ||
// plugins: { | ||
// 'react-refresh': reactRefresh | ||
// }, | ||
// rules: { | ||
// 'react-refresh/only-export-components': 'warn' | ||
// } | ||
// }, | ||
...compat.config({ | ||
extends: [ | ||
'plugin:react-hooks/recommended' | ||
// "plugin:react/recommended", | ||
// "plugin:react/jsx-runtime" | ||
], | ||
plugins: ['simple-import-sort'], | ||
rules: { | ||
'no-restricted-imports': [ | ||
'error', | ||
{ | ||
paths: [ | ||
{ | ||
name: 'react-redux', | ||
importNames: [ | ||
// TODO: Create typed hook for useDispatch | ||
// "useDispatch", | ||
'useSelector' | ||
], | ||
message: 'Use the typed hook "useTypedSelector" instead.' | ||
} | ||
] | ||
} | ||
], | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-duplicate-enum-values': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/no-inferrable-types': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'warn', | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
// TODO: Change this to true someday | ||
extendDefaults: false, | ||
types: { | ||
'React.FunctionComponent': { | ||
message: 'Use React.FC instead', | ||
fixWith: 'React.FC' | ||
} | ||
} | ||
} | ||
], | ||
'simple-import-sort/imports': 'error' | ||
} | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/pages/academy/adminPanel/subcomponents/NotificationConfigPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.