-
Notifications
You must be signed in to change notification settings - Fork 148
/
.eslintrc.cjs
73 lines (67 loc) · 2.43 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jsdoc/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:n/recommended",
"plugin:compat/recommended"
],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
ecmaVersion: 6,
sourceType: "module",
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: ["@typescript-eslint", "deprecation", "ie11"],
rules: {
// does not handle return types being annotated in a type comment
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"no-irregular-whitespace": "off",
"no-process-exit": "off",
// allow import syntax as we compile that away with babel for node
"n/no-unsupported-features/es-syntax": [
"error",
{
ignores: ["dynamicImport", "modules"],
},
],
// sometimes we need this with jsdoc typing
"@typescript-eslint/ban-ts-comment": "off",
// some typescript type productions do not parse
"jsdoc/valid-types": "off",
"jsdoc/no-undefined-types": "off",
// opt-out of providing descriptions for params, returns, and property
"jsdoc/require-property-description": "off",
"jsdoc/require-returns-description": "off",
"jsdoc/require-param-description": "off",
"jsdoc/tag-lines": ["error"|"warn", "any",{"startLines":0}],
"jsdoc/check-tag-names": [
"warn",
{
definedTags: ["internal", "beta"],
},
],
// reports usage of deprecated code
// <https://github.com/gund/eslint-plugin-deprecation>
"deprecation/deprecation": "warn",
// detecting unsupported ES6 features in IE11
"ie11/no-collection-args": "error",
"ie11/no-for-in-const": "error",
"ie11/no-loop-func": "warn",
"ie11/no-weak-collections": "error"
},
};