-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
77 lines (57 loc) · 1.69 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
// Support browser globals
browser: true,
// Set ES2022 environment
es2022: true,
// Support node globals
node: true,
},
extends: [
// Use recommended eslint rules
"eslint:recommended",
// Use recommended typescript-eslint rules
"plugin:@typescript-eslint/recommended",
// Use stylistic typescript-eslint rules
"plugin:@typescript-eslint/stylistic",
// Use recommended React rules
"plugin:react/recommended",
// Use recommended Lingui rules
"plugin:lingui/recommended",
// Use recommended perfectionist rules
"plugin:perfectionist/recommended-alphabetical-legacy",
// Turn off rules that might conflict with Prettier
"prettier",
],
// Use typescript-eslint parser
parser: "@typescript-eslint/parser",
parserOptions: {
// Allow ES2022 syntax
sourceType: "module",
},
plugins: [
// Use @typescript-eslint plugin
"@typescript-eslint",
// Use perfectionist plugin
"perfectionist",
],
// Ignore configuration files in directories above this one
root: true,
rules: {
// Use objects instead of records for empty types
"@typescript-eslint/consistent-indexed-object-style": [
"error",
"index-signature",
],
// Use types instead of interfaces
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
// Allow anonymous default exports
"import/no-anonymous-default-export": "off",
// Allow empty block statements
"no-empty": "off",
// Allow empty destructuring patterns
"no-empty-pattern": "off",
// Disable rule that requires React to be in scope
"react/react-in-jsx-scope": "off",
},
};