Repository navigation
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
53 lines (53 loc) · 1.49 KB
/
Copy path.eslintrc.cjs
File metadata and controls
53 lines (53 loc) · 1.49 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json'
},
plugins: ['@typescript-eslint', 'unused-imports'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
root: true,
env: {
node: true,
jest: true,
es6: true
},
ignorePatterns: [
'.eslintrc.cjs',
'dist',
'node_modules',
'tests',
'benchmarks',
'examples',
'security',
// Excluded from tsconfig too — linting it only yields parser errors.
'src/_archived',
'**/*.js',
'**/*.test.ts',
'**/*.spec.ts'
],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
// unused-imports auto-removes dead imports (autofixable); the TS rule is
// disabled to avoid double-reporting. Unused *variables* are still reported
// (no autofix) so dead locals remain visible without being mass-deleted.
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': ['error', {
'vars': 'all',
'varsIgnorePattern': '^_',
'args': 'after-used',
'argsIgnorePattern': '^_'
}],
'@typescript-eslint/no-inferrable-types': 'off',
'prefer-const': 'error',
'no-var': 'error'
},
};