diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-20 03:07:06 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-20 03:07:06 +0100 |
commit | 64ca9411865b45a0e9cfbdcffd431111a5582a9e (patch) | |
tree | 0f07ab7fb4f8362fd68581af75ce86c3192ee835 /language-web/.eslintrc.js | |
parent | build: upgrade to yarn 3 (diff) | |
download | refinery-64ca9411865b45a0e9cfbdcffd431111a5582a9e.tar.gz refinery-64ca9411865b45a0e9cfbdcffd431111a5582a9e.tar.zst refinery-64ca9411865b45a0e9cfbdcffd431111a5582a9e.zip |
chore(web): remove eslint-plugin-sonarjs
It is not compatible with eslint 8 yet:
https://github.com/SonarSource/eslint-plugin-sonarjs/issues/286
Diffstat (limited to 'language-web/.eslintrc.js')
-rw-r--r-- | language-web/.eslintrc.js | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/language-web/.eslintrc.js b/language-web/.eslintrc.js index 0e4dd5e3..b27feb0e 100644 --- a/language-web/.eslintrc.js +++ b/language-web/.eslintrc.js | |||
@@ -1,9 +1,40 @@ | |||
1 | // Loosely based on | ||
2 | // https://github.com/iamturns/create-exposed-app/blob/f14e435b8ce179c89cce3eea89e56202153a53da/.eslintrc.js | ||
1 | module.exports = { | 3 | module.exports = { |
2 | plugins: [ | 4 | plugins: [ |
3 | 'sonarjs', | 5 | '@typescript-eslint', |
4 | ], | 6 | ], |
5 | extends: [ | 7 | extends: [ |
6 | './.eslintrc.ci.js', | 8 | 'airbnb', |
7 | 'plugin:sonarjs/recommended', | 9 | 'airbnb-typescript', |
10 | 'airbnb/hooks', | ||
11 | 'plugin:@typescript-eslint/recommended', | ||
12 | 'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
13 | ], | ||
14 | parserOptions: { | ||
15 | project: './tsconfig.json', | ||
16 | }, | ||
17 | rules: { | ||
18 | // https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html | ||
19 | 'import/prefer-default-export': 'off', | ||
20 | 'import/no-default-export': 'error', | ||
21 | // propTypes are for runtime validation, but we rely on TypeScript for build-time validation: | ||
22 | // https://github.com/yannickcr/eslint-plugin-react/issues/2275#issuecomment-492003857 | ||
23 | 'react/prop-types': 'off', | ||
24 | // Make sure switches are exhaustive: https://stackoverflow.com/a/60166264 | ||
25 | 'default-case': 'off', | ||
26 | '@typescript-eslint/switch-exhaustiveness-check': 'error', | ||
27 | // https://github.com/airbnb/javascript/pull/2501 | ||
28 | 'react/function-component-definition': ['error', { | ||
29 | namedComponents: 'function-expression', | ||
30 | namedComponents: 'function-declaration', | ||
31 | }], | ||
32 | }, | ||
33 | env: { | ||
34 | browser: true, | ||
35 | }, | ||
36 | ignorePatterns: [ | ||
37 | '*.js', | ||
38 | 'build/**/*', | ||
8 | ], | 39 | ], |
9 | }; | 40 | }; |