-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
90 lines (89 loc) · 3.34 KB
/
eslint.config.mjs
File metadata and controls
90 lines (89 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import _eslintJs from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
const { configs: jsConfigs } = _eslintJs;
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
import typescriptEslintParser from '@typescript-eslint/parser';
import promisePlugin from 'eslint-plugin-promise';
export default [
jsConfigs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: typescriptEslintParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
import: importPlugin,
promise: promisePlugin,
'@typescript-eslint': typescriptEslintPlugin,
},
rules: {
...importPlugin.configs.recommended.rules,
...promisePlugin.configs.recommended.rules,
...typescriptEslintPlugin.configs.recommended.rules,
...typescriptEslintPlugin.configs['recommended-requiring-type-checking'].rules,
'no-console': 'error',
'no-bitwise': 'off',
strict: 'off',
'@typescript-eslint/no-unused-vars': ['error', {
vars: 'local',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_'
}],
'class-methods-use-this': 'off',
'no-useless-constructor': 'off',
'no-empty-function': 'off',
'@typescript-eslint/type-annotation-spacing': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/no-explicit-any': 'off',
'no-async-promise-executor': 'off',
'promise/no-callback-in-promise': 'off',
'promise/no-return-wrap': 'off',
'require-atomic-updates': 'off',
indent: ['error', 2, { FunctionDeclaration: { parameters: 'first' }, SwitchCase: 1 }],
'function-paren-newline': 'off',
'object-curly-newline': ['error', { consistent: true }],
'prefer-destructuring': ['error', { object: true, array: false }],
'no-restricted-globals': 'off',
'no-multiple-empty-lines': 'error',
'max-len': ['error', 140],
'no-unused-vars': 'off',
'no-return-assign': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/extensions': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'import/prefer-default-export': 'off',
'no-use-before-define': ['error', { functions: true, classes: true }],
'import/no-unresolved': 'off',
'no-underscore-dangle': 'off',
'no-undef': 'off',
'new-cap': ['error', { capIsNewExceptions: ['Router'] }],
},
},
{
files: ['**/*.spec.ts', '*.spec.ts', 'src/test-env.ts', 'src/setup.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'prefer-promise-reject-errors': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'max-classes-per-file': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
];