forked from arnog/mathlive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
145 lines (130 loc) · 5.07 KB
/
.eslintrc.json
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
134
135
136
137
138
139
140
141
142
143
144
145
{
"env": {
"browser": true,
// "commonjs": true,
"es6": true,
"node": true, // For jest, config files, etc...
"amd": true,
"mocha": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
// Configure the parser with the tsconfig file in the root project
// (or rather an extended version that add peripheral files such as rollup.config.js
// so that eslint doesn't complain that they are not in the project)
"project": "./tsconfig.eslint.json"
// "ecmaFeatures": { "jsx": false }, // default
// "ecmaVersion": 2020,
// "sourceType": "module" // Allow the use of import
},
"extends": [
// Uses the recommended rules for Typescript
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// Disable rules that conflict with prettier
// See https://prettier.io/docs/en/integrating-with-linters.html
"plugin:prettier/recommended"
],
// See http://eslint.org/docs/rules/
"rules": {
/// Temporary lenient rules until more complete conversion to
/// Typescript is completed. @revisit
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-untyped-public-signature": "warn",
// "@typescript-eslint/typedef": [
// "warn",
// {
// "parameter": true,
// "arrowParameter": false,
// "variableDeclaration": false
// }
// ],
"@typescript-eslint/array-type": ["warn", { "default": "array" }],
"@typescript-eslint/no-explicit-any": "off",
"prettier/prettier": "error",
// note you must disable the base rule as it can report incorrect errors
"indent": "off",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/generic-type-naming": ["warn", "^[A-Z][a-zA-Z]*$"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
// "varsIgnorePattern": "^_",
// "vars": "all",
// "args": "after-used",
// "ignoreRestSiblings": false
}
],
// "@typescript-eslint/explicit-function-return-type": [
// "warn",
// {
// "allowExpressions": true
// }
// ],
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": false,
"classes": false,
"variables": false,
"typedefs": false
}
],
"@typescript-eslint/no-this-alias": [
"error",
{
"allowedNames": ["self", "that"] // Allow `const self = this`; `[]` by default
}
],
"@typescript-eslint/no-for-in-array": "error",
// Note:
// "off" or 0 - turn the rule off
// "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
// "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
"no-const-assign": "warn",
"no-this-before-super": "warn",
// "no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"constructor-super": "warn",
"block-scoped-var": "error",
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["warn", "1tbs", { "allowSingleLine": true }],
"prefer-const": "warn",
"valid-typeof": "error",
"consistent-return": "error",
"curly": ["warn", "multi-line"],
"eqeqeq": ["error", "smart"],
"guard-for-in": "warn",
// "max-len": "warn",
"new-cap": "warn",
"no-bitwise": "off",
"no-console": "off",
"no-dupe-class-members": "off", // Support TypeScritp polymorphism
"no-else-return": "warn",
"no-eval": "error",
"no-fallthrough": "error",
"no-invalid-this": "warn",
"no-lone-blocks": "warn",
"no-return-assign": ["warn", "always"],
"no-redeclare": "off",
"no-self-compare": "error",
"no-sequences": "warn",
"no-unneeded-ternary": "warn",
"no-unused-expressions": "warn",
"no-useless-call": "warn",
"no-var": "error",
"no-with": "error",
// "vars-on-top": "warn",
"no-delete-var": "warn",
"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
"require-jsdoc": "off",
"space-infix-ops": ["error", { "int32Hint": false }],
"no-trailing-spaces": [1, { "skipBlankLines": true }]
}
}