generated from mingi3314/blog-stream
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
111 lines (111 loc) · 3.13 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
module.exports = {
root: true,
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
ecmaVersion: "latest",
sourceType: "module",
},
overrides: [
{
files: ["*.ts", "*.tsx"],
processor: "@graphql-eslint/graphql",
parser: "@typescript-eslint/parser",
plugins: [
"unicorn",
"import",
"react",
"react-hooks",
"jsx-a11y",
"@typescript-eslint",
],
extends: [
"plugin:unicorn/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
env: {
es2024: true,
},
rules: {
"unicorn/filename-case": 0,
"unicorn/prevent-abbreviations": 0,
"unicorn/no-abusive-eslint-disable": 0,
"import/no-duplicates": ["error", { "prefer-inline": true }],
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports" },
],
"@typescript-eslint/consistent-type-exports": "error",
"sort-imports": [
"error",
{
ignoreDeclarationSort: true,
},
],
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: { order: "asc" },
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
],
pathGroupsExcludedImportTypes: ["react", "react-dom"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "react-dom",
group: "external",
position: "before",
},
{
pattern: "~/**/*",
group: "internal",
position: "before",
},
],
},
],
"max-classes-per-file": "off",
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "warn",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/restrict-template-expressions": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
},
},
{
files: ["*.graphql"],
parser: "@graphql-eslint/eslint-plugin",
plugins: ["@graphql-eslint"],
rules: {
"@graphql-eslint/no-anonymous-operations": "error",
"@graphql-eslint/naming-convention": [
"error",
{
OperationDefinition: {
style: "PascalCase",
forbiddenPrefixes: ["Query", "Mutation", "Subscription", "Get"],
forbiddenSuffixes: ["Query", "Mutation", "Subscription"],
},
},
],
},
},
],
}