Update frontend linter

This commit is contained in:
jeffvli 2022-10-26 16:28:07 -07:00
parent 5b349083c9
commit 17258e950e
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,7 @@
module.exports = { module.exports = {
extends: ['erb', 'plugin:typescript-sort-keys/recommended'], extends: ['erb', 'plugin:typescript-sort-keys/recommended'],
ignorePatterns: ['.erb/*', 'server/*'], ignorePatterns: ['.erb/*', 'server'],
parser: '@typescript-eslint/parser',
parserOptions: { parserOptions: {
createDefaultProgram: true, createDefaultProgram: true,
ecmaVersion: 2020, ecmaVersion: 2020,
@ -8,12 +9,14 @@ module.exports = {
sourceType: 'module', sourceType: 'module',
tsconfigRootDir: __dirname, tsconfigRootDir: __dirname,
}, },
plugins: ['import', 'sort-keys-fix'], plugins: ['@typescript-eslint', 'import', 'sort-keys-fix'],
root: true, root: true,
rules: { rules: {
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': ['off'], '@typescript-eslint/no-shadow': ['off'],
'import/extensions': 'off',
// A temporary hack related to IDE not resolving correct package.json // A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off', 'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'error', 'import/no-unresolved': 'error',
@ -44,6 +47,7 @@ module.exports = {
'no-console': 'off', 'no-console': 'off',
'no-nested-ternary': 'off', 'no-nested-ternary': 'off',
'no-restricted-syntax': 'off', 'no-restricted-syntax': 'off',
'no-underscore-dangle': 'off',
'react/jsx-props-no-spreading': 'off', 'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-props': [ 'react/jsx-sort-props': [
'error', 'error',
@ -69,7 +73,6 @@ module.exports = {
node: { node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'], extensions: ['.js', '.jsx', '.ts', '.tsx'],
}, },
project: './tsconfig.json',
typescript: {}, typescript: {},
webpack: { webpack: {
config: require.resolve('./.erb/configs/webpack.config.eslint.ts'), config: require.resolve('./.erb/configs/webpack.config.eslint.ts'),

View File

@ -4,6 +4,11 @@
".prettierrc": "jsonc", ".prettierrc": "jsonc",
".eslintignore": "ignore" ".eslintignore": "ignore"
}, },
"eslint.validate": ["typescript"],
"eslint.workingDirectories": [
{ "directory": "./", "changeProcessCWD": true },
{ "directory": "./server", "changeProcessCWD": true }
],
"typescript.tsserver.experimental.enableProjectDiagnostics": true, "typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.tabSize": 2, "editor.tabSize": 2,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {