-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
23 lines (23 loc) · 1.73 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
{
"extends": "standard-with-typescript",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off", // useless boilerplate
"@typescript-eslint/array-type": "off", // would have forced you to use Array<CustomType> instead of CustomType[], silly
"@typescript-eslint/indent": "off", // too buggy when using decorators
"@typescript-eslint/no-extraneous-class": ["error", { "allowEmpty": true }],
"@typescript-eslint/no-non-null-assertion": "off", // would have disabled using ! to mark something as non-null,
// generally not avoidable without wasting cpu cycles on a check
"@typescript-eslint/no-unused-vars": "off", // typescript already reports this and VSCode darkens the variable
"@typescript-eslint/return-await": ["error", "always"], // allows you to accidentally break async stacktraces in node 14+
"@typescript-eslint/strict-boolean-expressions": "off", // we know how truthiness works, annoying to have to avoid
"@typescript-eslint/restrict-template-expressions": ["error", { "allowAny": true }], // `${myVar}` is fine if myVar is `any`
// disallow typecasting with e.g. <string> because it's very confusing vs generics
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
"@typescript-eslint/prefer-nullish-coalescing": ["error", { "ignoreConditionalTests": true }], // this is supposed to be the default but apparently standard-with-typescript overrode it to something stupid
"@typescript-eslint/prefer-readonly": "off", // readonly adds a lot of complication and often infects other code with its complexity
"new-cap": "off"
}
}