-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc
133 lines (133 loc) · 4.64 KB
/
.eslintrc
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"project": [
"./tsconfig.json",
"./tsconfig.spec.json",
"./tsconfig.stress.json"
]
},
"ignorePatterns": [
"**/*.json",
"**/*.md",
"**/*.yml",
"**/*.sh",
"**/*.html",
"**/*.css",
"prompts/**",
"scripts/**",
"scaffolding/**",
"pkg/**",
"docs/**",
"node_modules/**",
"dist/**"
],
"plugins": [
"@typescript-eslint",
"jsdoc",
"prettier",
"unused-imports"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
"plugin:jsdoc/recommended-typescript"
],
"rules": {
"unused-imports/no-unused-imports": "error",
"strict": "error",
"prettier/prettier": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/tag-lines": "off",
"jsdoc/no-undefined-types": "off",
"jsdoc/check-types": "off",
"jsdoc/require-hyphen-before-param-description": "error",
"semi": "off",
"@typescript-eslint/semi": "off",
"no-unexpected-multiline": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-duplicate-type-constituents": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-use-before-define": [
"warn",
{
"functions": false,
"classes": true,
"variables": true,
"typedefs": false
}
],
"arrow-body-style": "off", // conflicts with prettier
"class-methods-use-this": "off",
"curly": "off",
"eqeqeq": "off",
"import/extensions": "off",
"import/no-default-export": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off", // https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
"no-nested-ternary": "off",
"no-prototype-builtins": "off", // Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
"no-underscore-dangle": "off",
"prefer-arrow-callback": "off", // conflicts with prettier
/**
* This is a compatibility ruleset that:
* - disables rules from eslint:recommended which are already handled by TypeScript.
* - enables rules that make sense due to TS"s typechecking / transpilation.
* @see: {@link: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts}
*/
"constructor-super": "off", // ts(2335) & ts(2377)
"getter-return": "off", // ts(2378)
"no-const-assign": "off", // ts(2588)
"no-dupe-args": "off", // ts(2300)
"no-dupe-class-members": "off", // ts(2393) & ts(2300)
"no-dupe-keys": "off", // ts(1117)
"no-func-assign": "off", // ts(2539)
"no-import-assign": "off", // ts(2539) & ts(2540)
"no-new-symbol": "off", // ts(2588)
"no-obj-calls": "off", // ts(2349)
"no-redeclare": "off", // ts(2451)
"no-setter-return": "off", // ts(2408)
"no-this-before-super": "off", // ts(2376)
"no-undef": "off", // ts(2304)
"no-unreachable": "off", // ts(7027)
"no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358)
"no-use-before-define": "off",
"no-var": "error", // ts transpiles let/const to var, so no need for vars any more
"prefer-const": "error", // ts provides better types with const
"prefer-rest-params": "error", // ts provides better types with rest args over arguments
"prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply
"valid-typeof": "off", // ts(2367)
"no-constant-condition": "off"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts"
]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
// use an array of glob patterns
"project": [
"./tsconfig.json"
]
}
}
}
}