-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
.eslintrc.js
98 lines (94 loc) · 2.14 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
//@ts-check
/**
* ESlint Configuration
* @type {import('eslint').ESLint.ConfigData}
*/
const config = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import", "unused-imports"],
parserOptions: {
project: ["./tsconfig.json"],
},
rules: {
"no-unused-vars": "off", // Duplicate with unused-import/no-unused-vars
"no-param-reassign": "warn",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: false },
],
"@typescript-eslint/no-floating-promises": [
"warn",
{
ignoreIIFE: true,
},
],
// Import Rules
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
"newlines-between": "always",
pathGroups: [
{
pattern: "~/**",
group: "parent",
position: "before",
},
],
alphabetize: { order: "asc", caseInsensitive: true },
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports" },
],
"import/no-duplicates": ["error", { considerQueryString: true }],
// React
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
},
settings: {
react: {
version: "detect",
},
},
overrides: [
{
files: ["**/*.test.tsx", "**/*.test.ts"],
plugins: ["jest"],
env: {
"jest/globals": true,
},
extends: ["plugin:jest/recommended"],
},
],
ignorePatterns: ["*.js", "*.jsx"],
};
module.exports = config;