-
Notifications
You must be signed in to change notification settings - Fork 39
/
.eslintrc.js
83 lines (83 loc) · 2.38 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
ignorePatterns: ["exported-game-constants.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module"
},
plugins: ["@typescript-eslint", "import"],
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
typescript: {}
},
"import/core-modules": [
"game",
"game/prototypes",
"game/utils",
"game/path-finder",
"game/constants",
"game/visual",
"arena",
"arena/prototypes",
"arena/constants"
] // https://github.com/benmosher/eslint-plugin-import/blob/v2.22.1/README.md#importcore-modules
},
rules: {
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "explicit"
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": ["error", { functions: false }],
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/unified-signatures": "error",
camelcase: "error",
"@typescript-eslint/dot-notation": "error",
eqeqeq: ["error", "smart"],
"id-denylist": ["error", "any", "Number", "number", "String", "string", "Boolean", "boolean", "Undefined"],
"id-match": "error",
"max-classes-per-file": ["error", 1],
"no-bitwise": "error",
"no-caller": "error",
"no-eval": "error",
"no-new-wrappers": "error",
"@typescript-eslint/no-shadow": [
"error",
{
hoist: "all"
}
],
"@typescript-eslint/no-throw-literal": "error",
"no-undef-init": "error",
"no-underscore-dangle": "warn",
"no-var": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
radix: "error",
"sort-imports": "warn",
"spaced-comment": "error"
}
};