Skip to content

Commit

Permalink
chore(web): remove eslint-plugin-sonarjs
Browse files Browse the repository at this point in the history
It is not compatible with eslint 8 yet:
SonarSource/eslint-plugin-sonarjs#286
  • Loading branch information
kris7t committed Nov 20, 2021
1 parent 40ebe00 commit 64ca941
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 55 deletions.
40 changes: 0 additions & 40 deletions language-web/.eslintrc.ci.js

This file was deleted.

37 changes: 34 additions & 3 deletions language-web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
// Loosely based on
// https://github.com/iamturns/create-exposed-app/blob/f14e435b8ce179c89cce3eea89e56202153a53da/.eslintrc.js
module.exports = {
plugins: [
'sonarjs',
'@typescript-eslint',
],
extends: [
'./.eslintrc.ci.js',
'plugin:sonarjs/recommended',
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parserOptions: {
project: './tsconfig.json',
},
rules: {
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
// propTypes are for runtime validation, but we rely on TypeScript for build-time validation:
// https://github.com/yannickcr/eslint-plugin-react/issues/2275#issuecomment-492003857
'react/prop-types': 'off',
// Make sure switches are exhaustive: https://stackoverflow.com/a/60166264
'default-case': 'off',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
// https://github.com/airbnb/javascript/pull/2501
'react/function-component-definition': ['error', {
namedComponents: 'function-expression',
namedComponents: 'function-declaration',
}],
},
env: {
browser: true,
},
ignorePatterns: [
'*.js',
'build/**/*',
],
};
3 changes: 1 addition & 2 deletions language-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"serve": "webpack serve --node-env development --hot",
"check": "yarn run check:eslint && yarn run check:stylelint",
"check:eslint": "eslint .",
"check:eslint:ci": "eslint -c ./.eslintrc.ci.js -f json -o build/eslint.json .",
"check:eslint:ci": "eslint -f json -o build/eslint.json .",
"check:stylelint": "stylelint src/main/css/**/*.scss",
"check:stylelint:ci": "stylelint -f json src/main/css/**/*.scss > build/stylelint.json"
},
Expand Down Expand Up @@ -45,7 +45,6 @@
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-sonarjs": "^0.10.0",
"html-webpack-plugin": "^5.5.0",
"image-webpack-loader": "^8.0.1",
"magic-comments-loader": "^1.4.1",
Expand Down
10 changes: 0 additions & 10 deletions language-web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4571,15 +4571,6 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-sonarjs@npm:^0.10.0":
version: 0.10.0
resolution: "eslint-plugin-sonarjs@npm:0.10.0"
peerDependencies:
eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
checksum: 6ef5b2050180a612b310610d9b1f2a89508ecf41326573cd62977ad085b25a6be7e31f47eee5857fb43b4bbd1bea1454419b52545ee3cb6cb2185a1938872009
languageName: node
linkType: hard

"eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1":
version: 5.1.1
resolution: "eslint-scope@npm:5.1.1"
Expand Down Expand Up @@ -8721,7 +8712,6 @@ __metadata:
eslint-plugin-jsx-a11y: ^6.5.1
eslint-plugin-react: ^7.27.1
eslint-plugin-react-hooks: ^4.3.0
eslint-plugin-sonarjs: ^0.10.0
html-webpack-plugin: ^5.5.0
image-webpack-loader: ^8.0.1
loglevel: ^1.8.0
Expand Down

0 comments on commit 64ca941

Please sign in to comment.