This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
102 lines (101 loc) · 2.5 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
/**
* @type {import("eslint").Linter.Config}
*/
const config = {
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
},
plugins: ["unused-imports", "import", "jest"],
env: {
es2021: true,
browser: true,
node: true,
jest: true,
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
extends: [
"eslint:recommended",
"airbnb",
"airbnb/hooks",
"plugin:import/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:react/recommended",
"prettier",
],
overrides: [
{
files: ["*.ts", "*.tsx"],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
},
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"prettier",
],
rules: {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"react/require-default-props": "off",
"@typescript-eslint/no-floating-promises": "error",
"no-void": ["error", { allowAsStatement: true }],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
},
},
],
rules: {
"no-console": "off",
"no-plusplus": "off",
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never",
},
],
"import/no-unused-modules": [1, { unusedExports: true }],
"import/prefer-default-export": "off",
"react/jsx-filename-extension": [2, { extensions: [".jsx", ".tsx"] }],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
"import/no-extraneous-dependencies": [
"error",
{ devDependencies: ["**/*.test.*", "jestSetupFile.ts"] },
],
},
};
module.exports = config;