-
Notifications
You must be signed in to change notification settings - Fork 142
/
.eslintrc.js
60 lines (56 loc) · 1.87 KB
/
.eslintrc.js
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
module.exports = {
root: true,
env: {
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
project: ['./packages/*/tsconfig.json', './examples/tsconfig.json'],
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'prettier', 'import', 'jest', 'eslint-plugin-tsdoc'],
extends: [
'airbnb-typescript/base',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
"plugin:prettier/recommended"
],
rules: {
// airbnb default is 1
'max-classes-per-file': ['error', 5],
// never allow default export
'import/prefer-default-export': 'off',
// never allow default export
'import/no-default-export': 'error',
// added by airbnb not-practical for entity-relation definitions
'import/no-cycle': 'off',
// needed so we can use class scoped generics in methods.
'class-methods-use-this': 'off',
// airbnb default this doesnt work when using parameter decorators.
'@typescript-eslint/no-useless-constructor': 'off',
// override airbnb to allow class interface merging
"@typescript-eslint/no-redeclare": ["error", {ignoreDeclarationMerge: true}]
},
ignorePatterns: ['**/dist', '**/node_modules'],
overrides: [
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
],
};