-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
84 lines (66 loc) · 1.81 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
78
79
80
81
82
83
84
module.exports = {
env: {
// Set ES2022 environment
es2022: true,
},
extends: [
// Use Next.js core web vitals rules
"next/core-web-vitals",
// 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 Lingui rules
"plugin:lingui/recommended",
// Use recommended perfectionist rules
"plugin:perfectionist/recommended-alphabetical-legacy",
// Turn off rules that might conflict with Prettier
"prettier",
],
overrides: [
{
// Apply rules to generated types
files: ["*.d.ts"],
rules: {
// Allow empty object types
"@typescript-eslint/no-empty-object-type": [
"error",
{
allowObjectTypes: "always",
},
],
},
},
],
// 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",
},
};