-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
105 lines (104 loc) · 2.97 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/** @type {import("eslint").Linter.Config} */
const config = {
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: true,
},
env: {
es2024: true,
},
plugins: ["jsx-a11y", "@typescript-eslint", "unicorn"],
extends: [
"plugin:jsx-a11y/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
"plugin:import/warnings",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"xo",
"xo-react",
],
rules: {
// These opinionated rules are enabled in stylistic-type-checked above.
// Feel free to reconfigure them to your own preference.
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "separate-type-imports",
},
],
"@typescript-eslint/no-unused-vars": ["error"],
"no-console": "error",
semi: "error",
indent: "off",
"arrow-parens": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"quote-props": ["error", "as-needed"],
quotes: ["error", "double", { allowTemplateLiterals: true }],
"linebreak-style": "off",
"jsx-quotes": ["error", "prefer-double"],
complexity: ["error", 40],
"operator-linebreak": "off",
"react/jsx-curly-newline": "off",
"no-extra-parens": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react*",
group: "external",
position: "before",
},
{
pattern: "@at",
group: "external",
position: "after",
},
],
pathGroupsExcludedImportTypes: ["react*"],
alphabetize: {
order: "asc",
caseInsensitive: false,
},
"newlines-between": "always-and-inside-groups",
warnOnUnassignedImports: false,
},
],
"comma-dangle": [
"error",
{
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "never",
},
],
"react/jsx-fragments": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"react/jsx-tag-spacing": ["error", { beforeSelfClosing: "always" }],
"react/function-component-definition": "off",
"unicorn/no-null": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/prefer-at": ["error", { checkAllIndexAccess: true }],
},
};
module.exports = config;