From 17258e950e1140fdf66fcbaa14055941fa1ac6e1 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 26 Oct 2022 16:28:07 -0700 Subject: [PATCH] Update frontend linter --- .eslintrc.js | 9 ++++++--- .vscode/settings.json | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 31e3e8ad..e1413ec1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,7 @@ module.exports = { extends: ['erb', 'plugin:typescript-sort-keys/recommended'], - ignorePatterns: ['.erb/*', 'server/*'], + ignorePatterns: ['.erb/*', 'server'], + parser: '@typescript-eslint/parser', parserOptions: { createDefaultProgram: true, ecmaVersion: 2020, @@ -8,12 +9,14 @@ module.exports = { sourceType: 'module', tsconfigRootDir: __dirname, }, - plugins: ['import', 'sort-keys-fix'], + plugins: ['@typescript-eslint', 'import', 'sort-keys-fix'], root: true, rules: { + '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-shadow': ['off'], + 'import/extensions': 'off', // A temporary hack related to IDE not resolving correct package.json 'import/no-extraneous-dependencies': 'off', 'import/no-unresolved': 'error', @@ -44,6 +47,7 @@ module.exports = { 'no-console': 'off', 'no-nested-ternary': 'off', 'no-restricted-syntax': 'off', + 'no-underscore-dangle': 'off', 'react/jsx-props-no-spreading': 'off', 'react/jsx-sort-props': [ 'error', @@ -69,7 +73,6 @@ module.exports = { node: { extensions: ['.js', '.jsx', '.ts', '.tsx'], }, - project: './tsconfig.json', typescript: {}, webpack: { config: require.resolve('./.erb/configs/webpack.config.eslint.ts'), diff --git a/.vscode/settings.json b/.vscode/settings.json index 5f157fe6..8bcf89ca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,6 +4,11 @@ ".prettierrc": "jsonc", ".eslintignore": "ignore" }, + "eslint.validate": ["typescript"], + "eslint.workingDirectories": [ + { "directory": "./", "changeProcessCWD": true }, + { "directory": "./server", "changeProcessCWD": true } + ], "typescript.tsserver.experimental.enableProjectDiagnostics": true, "editor.tabSize": 2, "editor.codeActionsOnSave": {