-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
115 lines (113 loc) · 3.3 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
112
113
114
115
// @ts-check
const stylistic = require("@stylistic/eslint-plugin");
const { rules: stylisticRules } = stylistic.configs.customize({
// the following options are the default values
indent: 4,
quotes: "double",
semi: true,
arrowParens: true,
commaDangle: "never",
quoteProps: "as-needed"
});
/** @type {import("eslint").ESLint.ConfigData} */
module.exports = {
root: true,
plugins: [
"@typescript-eslint",
"@stylistic"
],
parserOptions: {
project: "./tsconfig.json"
},
ignorePatterns: ["**/*.js"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:eslint-plugin-react/recommended",
"plugin:eslint-plugin-react/jsx-runtime",
"plugin:eslint-plugin-import/recommended",
"plugin:eslint-plugin-import/typescript",
"plugin:@next/eslint-plugin-next/recommended",
"plugin:@next/eslint-plugin-next/core-web-vitals",
"plugin:eslint-plugin-promise/recommended",
"plugin:eslint-plugin-jsx-a11y/strict",
"plugin:eslint-plugin-sonarjs/recommended"
],
settings: {
react: {
version: "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"typescript": true
}
},
rules: {
...stylisticRules,
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/non-nullable-type-assertion-style": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumber: true,
allowRegExp: false,
allowNever: false,
},
],
"sort-imports": [
"warn",
{
"ignoreDeclarationSort": true
}
],
"import/order": [
"warn",
{
"groups": [
[
"builtin",
"external"
],
"internal",
[
"sibling",
"parent",
"index"
]
],
"pathGroups": [
{
"pattern": "~**",
"group": "internal"
}
],
"pathGroupsExcludedImportTypes": [],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"warnOnUnassignedImports": true
}
],
"jsx-a11y/no-autofocus": "off",
"sonarjs/no-inverted-boolean-check": "error",
"sonarjs/no-duplicate-string": "off",
}
}