-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
103 lines (99 loc) · 2.74 KB
/
.eslintrc
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
{
"root": true,
"env": {
"browser": true,
"es2021": true
},
// Ignore plugins scripts
"ignorePatterns": ["**/plugins/**/*.js"],
"extends": [
"airbnb",
"airbnb-typescript",
"plugin:prettier/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"parser": "@typescript-eslint/parser",
"plugins": [
"react",
"react-refresh",
"@typescript-eslint",
"@tanstack/query",
"import", // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#groups-array
"prettier" // https://prettier.io/docs/en/install.html
],
"rules": {
// To fix - TypeError: Error while loading rule '@typescript-eslint/comma-dangle': Cannot read property 'ecmaVersion' of undefined.
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
// Off rules
"max-len": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off",
"react/prop-types": "off",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"react/jsx-no-bind": "off",
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/require-default-props": "off",
// Typescript
"@typescript-eslint/default-param-last": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
}
],
// Common rules
"complexity": ["warn", { "max": 15 }],
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
"import/newline-after-import": "error",
"sort-imports": ["error", {
"ignoreCase": false,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["single", "multiple", "all", "none"],
"allowSeparatedGroups": true
}],
"import/order": ["error", {
"newlines-between": "always",
"pathGroupsExcludedImportTypes": ["internal"],
"groups": [
["builtin", "external"],
["parent", "sibling", "internal", "index"]
],
"pathGroups": [
{
"pattern": "@app/**",
"group": "internal"
},
{
"pattern": "@lib/**",
"group": "internal"
},
{
"pattern": "@ui/**",
"group": "internal"
},
{
"pattern": "@assets/**",
"group": "internal",
"position": "after"
},
{
"pattern": "src/**",
"group": "internal"
}
]
}],
// React rules
"react/jsx-max-props-per-line": ["error", { "maximum": 2 }]
}
}