2022-10-12 14:21:49 +00:00
module . exports = {
env : {
browser : true ,
es2021 : true ,
} ,
extends : [
'airbnb' ,
'plugin:import/errors' ,
'plugin:import/typescript' ,
2024-06-10 18:38:32 +00:00
'plugin:import/warnings' ,
'plugin:prettier/recommended' ,
'plugin:react-hooks/recommended' ,
'plugin:react/recommended' ,
'plugin:sonarjs/recommended-legacy' ,
2022-10-12 14:21:49 +00:00
] ,
parser : '@typescript-eslint/parser' ,
parserOptions : {
ecmaFeatures : {
jsx : true ,
} ,
ecmaVersion : 'latest' ,
sourceType : 'module' ,
} ,
2024-06-10 18:38:32 +00:00
plugins : [
'@typescript-eslint' ,
'react' ,
'react-hooks' ,
'sonarjs' ,
'unused-imports' ,
] ,
2022-10-12 14:21:49 +00:00
rules : {
2023-04-04 13:13:56 +00:00
// according to https://github.com/typescript-eslint/typescript-eslint/issues/2621, You should turn off the eslint core rule and turn on the typescript-eslint rule
// but not sure which of the above "extends" statements is maybe bringing in eslint core
2023-04-27 21:33:25 +00:00
'max-len' : [ 'error' , { code : 200 , ignoreUrls : true } ] ,
2023-04-04 13:13:56 +00:00
'no-shadow' : 'off' ,
'@typescript-eslint/no-shadow' : [ 'error' ] ,
2022-10-12 14:21:49 +00:00
'jest/expect-expect' : 'off' ,
'react/jsx-no-bind' : 'off' ,
2024-06-10 18:38:32 +00:00
// FIXME: turn this back on someday
'react/jsx-key' : 'off' ,
2022-10-12 14:21:49 +00:00
'jsx-a11y/no-autofocus' : 'off' ,
'jsx-a11y/label-has-associated-control' : 'off' ,
'no-console' : 'off' ,
'react/jsx-filename-extension' : [
2023-12-18 19:23:51 +00:00
'warn' ,
2022-10-12 14:21:49 +00:00
{ extensions : [ '.js' , '.jsx' , '.tsx' , '.ts' ] } ,
] ,
'react/react-in-jsx-scope' : 'off' ,
'react/require-default-props' : 'off' ,
2022-11-15 22:35:16 +00:00
'import/prefer-default-export' : 'off' ,
2023-04-04 13:13:56 +00:00
'no-unused-vars' : 'off' ,
2023-05-12 21:07:53 +00:00
'unused-imports/no-unused-imports' : 'error' ,
'unused-imports/no-unused-vars' : [
'warn' ,
{
vars : 'all' ,
varsIgnorePattern : '^_' ,
args : 'after-used' ,
argsIgnorePattern : '^_' ,
} ,
] ,
2023-04-04 13:13:56 +00:00
'@typescript-eslint/no-unused-vars' : [
2022-10-12 14:21:49 +00:00
'error' ,
{
destructuredArrayIgnorePattern : '^_' ,
varsIgnorePattern : '_' ,
argsIgnorePattern : '^_' ,
} ,
] ,
'import/extensions' : [
'error' ,
'ignorePackages' ,
{
js : 'never' ,
jsx : 'never' ,
ts : 'never' ,
tsx : 'never' ,
} ,
] ,
2023-12-18 19:23:51 +00:00
curly : [ 'error' , 'all' ] ,
2022-10-12 14:21:49 +00:00
} ,
2024-06-10 18:38:32 +00:00
overrides : [
{
files : [ '**/*.test.ts' , '**/*.test.tsx' ] ,
env : {
jest : true ,
} ,
} ,
] ,
2022-10-12 14:21:49 +00:00
} ;