1+ {
2+ "root": true,
3+ "parser": "@typescript-eslint/parser",
4+ "plugins": ["@typescript-eslint"],
5+ "parserOptions": {
6+ "ecmaVersion": 2017,
7+ "sourceType": "module"
8+ },
9+ "rules": {
10+ // ban debug stuff
11+ "no-console": "error",
12+ "no-debugger": "error",
13+ // function writing rules
14+ "max-params": ["error", 3],
15+ "max-depth": ["error", 3],
16+ "no-unreachable": "error",
17+ "no-else-return": "error",
18+ "no-var": "error",
19+ "one-var": ["error", "never"],
20+ "init-declarations": ["error", "always"],
21+ // namings
22+ "camelcase": "error",
23+ "id-length": [
24+ "error",
25+ // "x" is for anonymous lambdas, "i" is for iterators in "for" loops
26+ { "min": 3, "max": 40, "exceptions": ["x", "i", "id"] }
27+ ],
28+ // common code style
29+ "curly": "error",
30+ "prefer-const": "error",
31+ "no-redeclare": "error",
32+ "prefer-destructuring": [
33+ "error",
34+ { "object": true, "array": false },
35+ { "enforceForRenamedProperties": false }
36+ ],
37+ "eqeqeq": "error",
38+ "default-case": "error",
39+ "no-magic-numbers": "off",
40+ "@typescript-eslint/no-magic-numbers": ["error", { "ignoreArrayIndexes": true, "ignoreEnums": true, "ignore": [0, 1, -1] }],
41+ "no-unused-expressions": "error",
42+ "@typescript-eslint/no-unused-vars": "error",
43+ "no-nested-ternary": "error",
44+ "no-empty": "error",
45+ "for-direction": "error",
46+ "no-sparse-arrays": "error",
47+ "yoda": "error"
48+ }
49+ }
0 commit comments