-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
115 lines (106 loc) · 3.67 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const aliases = require("./build/aliases.js");
const aliasList = Object.entries(aliases).reduce(
(arr, [key, val]) => [...arr, [key, val]],
[]
);
module.exports = {
ignorePatterns: ["**/*.js"],
env: {
"browser": true,
"es2021": true,
"node": true,
"jest/globals": true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:import/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
debugLevel: true,
},
plugins: ["react", "jest", "jest-extended", "jsx-a11y"],
rules: {
"quotes": ["error", "double"],
"no-extra-semi": ["error"],
"no-console": ["warn", { allow: ["error"] }],
"liebreak-style": 0,
"no-empty": ["error", { allowEmptyCatch: true }],
"no-unused-vars": "off",
"no-empty-function": "off",
"no-prototype-builtins": "off",
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": ["error", "always"],
"space-in-parens": ["error", "always", { exceptions: ["empty"] }],
"computed-property-spacing": ["error", "never"],
"object-curly-newline": [
"error",
{
multiline: true,
consistent: true,
},
],
"padded-blocks": ["error", "never", { allowSingleLineBlocks: true }],
"react/display-name": 0,
"react/prop-types": 0,
"import/no-duplicates": 0,
"import/no-unresolved": 0,
"import/namespace": 0,
"import/named": 0,
"import/default": 0,
"import/no-named-as-default-member": 0,
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowNumber: true, allowBoolean: true },
],
"@typescript-eslint/no-dynamic-delete": "off",
// revisit these
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/consistent-type-definitions": "off",
// until it stops fighting with itself
"@typescript-eslint/no-inferrable-types": "off",
},
globals: {
__static: true,
},
settings: {
"react": {
pragma: "React",
fragment: "Fragment",
version: "18.0.0",
},
"import/resolver": {
alias: {
map: [...aliasList, ["common", "./src/common"]],
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
"import/ignore": [".worker.js"],
},
};