-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.json
125 lines (125 loc) · 4.09 KB
/
.eslintrc.json
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
116
117
118
119
120
121
122
123
124
125
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "unicorn", "sort-class-members"],
"extends": [
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:import/recommended",
"plugin:import/typescript",
"prettier" // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"sort-class-members/sort-class-members": [
"error",
{
"order": [
"[static-properties]",
"[static-methods]",
"[properties]",
"[conventional-private-properties]",
"constructor",
"[methods]",
"[conventional-private-methods]"
],
"accessorPairPositioning": "getThenSet"
}
],
"import/no-duplicates": "error",
"import/no-unresolved": "off",
"import/no-named-as-default": "off",
"max-classes-per-file": "error",
"no-useless-escape": "off",
"react/display-name": "warn",
"react/jsx-no-target-blank": "warn",
// https://github.com/standard/eslint-config-standard-with-typescript/issues/248
"react/no-deprecated": "warn",
"react/no-unescaped-entities": "off",
"react/no-unknown-property": "warn",
// as of v17 no longer required
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/interface-name-prefix": "off",
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
// NOTE - typings throughout the platform are fairly inconsistent, hence the wide range of rules
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
{
"selector": "classMethod",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
// ignore cases where have to quote property names
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md#ignore-properties-that-require-quotes
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
"format": null,
"modifiers": ["requiresQuotes"]
},
// allow __html prop
// https://github.com/typescript-eslint/typescript-eslint/issues/1712
{
"selector": "property",
"filter": "__html",
"format": null
}
],
// Filenames - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
"unicorn/filename-case": [
"warn",
{
"cases": {
"camelCase": true,
"pascalCase": true
},
"ignore": ["ci/", ""]
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-namespace": "off",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "next/image",
"message": "Please use next-export-optimize-images/image instead"
}
]
}
]
}
}