diff --git a/language-web/.eslintrc.ci.js b/language-web/.eslintrc.ci.js deleted file mode 100644 index b27feb0ec..000000000 --- a/language-web/.eslintrc.ci.js +++ /dev/null @@ -1,40 +0,0 @@ -// Loosely based on -// https://github.com/iamturns/create-exposed-app/blob/f14e435b8ce179c89cce3eea89e56202153a53da/.eslintrc.js -module.exports = { - plugins: [ - '@typescript-eslint', - ], - extends: [ - '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/**/*', - ], -}; diff --git a/language-web/.eslintrc.js b/language-web/.eslintrc.js index 0e4dd5e3b..b27feb0ec 100644 --- a/language-web/.eslintrc.js +++ b/language-web/.eslintrc.js @@ -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/**/*', ], }; diff --git a/language-web/package.json b/language-web/package.json index 0fca5d94f..39a8036b9 100644 --- a/language-web/package.json +++ b/language-web/package.json @@ -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" }, @@ -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", diff --git a/language-web/yarn.lock b/language-web/yarn.lock index 25d8eb5b7..5a4a01f26 100644 --- a/language-web/yarn.lock +++ b/language-web/yarn.lock @@ -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" @@ -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