-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
64 lines (64 loc) Β· 2.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
61
62
63
64
module.exports = {
env: {
browser: false,
node: true,
es6: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: ["node_modules/", ".eslintrc.js", "dist/", "docs/", "examples/", "jest.config.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json"],
sourceType: "module",
},
plugins: ["prefer-arrow", "@typescript-eslint", "prettier"],
rules: {
// The typescript version adds extra checks on top of the eslint version, so we disable the eslint version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/init-declarations.md
"@typescript-eslint/init-declarations": ["error"],
"init-declarations": "off",
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
"no-eq-null": ["error"],
"no-undef": "off", //typescript will catch these
"no-dupe-class-members": "off",
"@typescript-eslint/no-dupe-class-members": ["error"],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-inferrable-types": "off",
"no-extra-boolean-cast": "off",
"no-multi-spaces": "error",
"@typescript-eslint/no-unused-vars": "off", //this rule is a bit buggy atm, it picks up things as unused when they are
"@typescript-eslint/adjacent-overload-signatures": "error",
//https://github.com/typescript-eslint/typescript-eslint/issues/1856
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/interface-name-prefix": "off", //deprecated in favor of naming-convention rule
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-irregular-whitespace": "off",
"no-prototype-builtins": "off", //should enable, although very unlikely to break in our case
"prefer-rest-params": "off", //should consider setting this to warn
"prefer-spread": "off", //should consider setting this to warn
"no-case-declarations": "off", //should consider enabling
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/array-type": [
//consider enabling as error
"off",
{
default: "array-simple",
},
],
"@typescript-eslint/quotes": [
"error",
"double",
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
"@typescript-eslint/no-non-null-assertion": "error",
"prettier/prettier": "error",
},
};