diff options
-rw-r--r-- | language-web/.eslintrc.ci.js | 40 | ||||
-rw-r--r-- | language-web/.eslintrc.js | 37 | ||||
-rw-r--r-- | language-web/package.json | 3 | ||||
-rw-r--r-- | language-web/yarn.lock | 10 |
4 files changed, 35 insertions, 55 deletions
diff --git a/language-web/.eslintrc.ci.js b/language-web/.eslintrc.ci.js deleted file mode 100644 index b27feb0e..00000000 --- a/language-web/.eslintrc.ci.js +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | // Loosely based on | ||
2 | // https://github.com/iamturns/create-exposed-app/blob/f14e435b8ce179c89cce3eea89e56202153a53da/.eslintrc.js | ||
3 | module.exports = { | ||
4 | plugins: [ | ||
5 | '@typescript-eslint', | ||
6 | ], | ||
7 | extends: [ | ||
8 | 'airbnb', | ||
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/**/*', | ||
39 | ], | ||
40 | }; | ||
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 | }; |
diff --git a/language-web/package.json b/language-web/package.json index 0fca5d94..39a8036b 100644 --- a/language-web/package.json +++ b/language-web/package.json | |||
@@ -9,7 +9,7 @@ | |||
9 | "serve": "webpack serve --node-env development --hot", | 9 | "serve": "webpack serve --node-env development --hot", |
10 | "check": "yarn run check:eslint && yarn run check:stylelint", | 10 | "check": "yarn run check:eslint && yarn run check:stylelint", |
11 | "check:eslint": "eslint .", | 11 | "check:eslint": "eslint .", |
12 | "check:eslint:ci": "eslint -c ./.eslintrc.ci.js -f json -o build/eslint.json .", | 12 | "check:eslint:ci": "eslint -f json -o build/eslint.json .", |
13 | "check:stylelint": "stylelint src/main/css/**/*.scss", | 13 | "check:stylelint": "stylelint src/main/css/**/*.scss", |
14 | "check:stylelint:ci": "stylelint -f json src/main/css/**/*.scss > build/stylelint.json" | 14 | "check:stylelint:ci": "stylelint -f json src/main/css/**/*.scss > build/stylelint.json" |
15 | }, | 15 | }, |
@@ -45,7 +45,6 @@ | |||
45 | "eslint-plugin-jsx-a11y": "^6.5.1", | 45 | "eslint-plugin-jsx-a11y": "^6.5.1", |
46 | "eslint-plugin-react": "^7.27.1", | 46 | "eslint-plugin-react": "^7.27.1", |
47 | "eslint-plugin-react-hooks": "^4.3.0", | 47 | "eslint-plugin-react-hooks": "^4.3.0", |
48 | "eslint-plugin-sonarjs": "^0.10.0", | ||
49 | "html-webpack-plugin": "^5.5.0", | 48 | "html-webpack-plugin": "^5.5.0", |
50 | "image-webpack-loader": "^8.0.1", | 49 | "image-webpack-loader": "^8.0.1", |
51 | "magic-comments-loader": "^1.4.1", | 50 | "magic-comments-loader": "^1.4.1", |
diff --git a/language-web/yarn.lock b/language-web/yarn.lock index 25d8eb5b..5a4a01f2 100644 --- a/language-web/yarn.lock +++ b/language-web/yarn.lock | |||
@@ -4571,15 +4571,6 @@ __metadata: | |||
4571 | languageName: node | 4571 | languageName: node |
4572 | linkType: hard | 4572 | linkType: hard |
4573 | 4573 | ||
4574 | "eslint-plugin-sonarjs@npm:^0.10.0": | ||
4575 | version: 0.10.0 | ||
4576 | resolution: "eslint-plugin-sonarjs@npm:0.10.0" | ||
4577 | peerDependencies: | ||
4578 | eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 | ||
4579 | checksum: 6ef5b2050180a612b310610d9b1f2a89508ecf41326573cd62977ad085b25a6be7e31f47eee5857fb43b4bbd1bea1454419b52545ee3cb6cb2185a1938872009 | ||
4580 | languageName: node | ||
4581 | linkType: hard | ||
4582 | |||
4583 | "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": | 4574 | "eslint-scope@npm:5.1.1, eslint-scope@npm:^5.1.1": |
4584 | version: 5.1.1 | 4575 | version: 5.1.1 |
4585 | resolution: "eslint-scope@npm:5.1.1" | 4576 | resolution: "eslint-scope@npm:5.1.1" |
@@ -8721,7 +8712,6 @@ __metadata: | |||
8721 | eslint-plugin-jsx-a11y: ^6.5.1 | 8712 | eslint-plugin-jsx-a11y: ^6.5.1 |
8722 | eslint-plugin-react: ^7.27.1 | 8713 | eslint-plugin-react: ^7.27.1 |
8723 | eslint-plugin-react-hooks: ^4.3.0 | 8714 | eslint-plugin-react-hooks: ^4.3.0 |
8724 | eslint-plugin-sonarjs: ^0.10.0 | ||
8725 | html-webpack-plugin: ^5.5.0 | 8715 | html-webpack-plugin: ^5.5.0 |
8726 | image-webpack-loader: ^8.0.1 | 8716 | image-webpack-loader: ^8.0.1 |
8727 | loglevel: ^1.8.0 | 8717 | loglevel: ^1.8.0 |