-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
64 lines (57 loc) · 1.94 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
const path = require("path");
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
// Using the recommended typescript configurations
"plugin:@typescript-eslint/recommended",
// Prettier - last to override all other formatting rules
"prettier",
],
parser: "@typescript-eslint/parser",
overrides: [
{
files: ["**/constants.ts", "**/constant.ts"],
rules: {
"@typescript-eslint/no-magic-numbers": ["off"],
},
},
],
parserOptions: {
ecmaVersion: "latest",
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint"],
ignorePatterns: ["**/build", "**/generated"],
rules: {
// Give the power to the people! We decided to leave this decision up to the dev.
"@typescript-eslint/no-inferrable-types": "off",
// We utilize namespaces and this change seems to be a matter of preference. Off for now.
"@typescript-eslint/no-namespace": "off",
// We want to make sure to correct for this. It can be difficult to debug when errors arise from this assertion.
"@typescript-eslint/no-non-null-assertion": "off",
// Enforce for cleanliness
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-types": [
"error",
{
types: {
// un-ban BigInt - It must be getting confused with the native bigInt type
BigInt: false,
},
extendDefaults: true,
},
],
// disallow magic numbers: https://eslint.org/docs/latest/rules/no-magic-numbers
"@typescript-eslint/no-magic-numbers": [
"error",
{
ignoreArrayIndexes: true,
ignore: [-1, 0, 1, 2, 3],
},
],
},
};