-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
94 lines (94 loc) · 2.95 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
{
"env": {
"browser": true,
"node": true,
"es2021": true
},
"plugins": [
"react", // @eslint-plugin-react
"react-hooks", // @eslint-plugin-react-hooks
"import", // @eslint-plugin-import
"jsx-a11y", // @eslint-plugin-jsx-a11y
"@typescript-eslint", // @typescript-eslint/eslint-plugin
"jest", // @eslint-plugin-jest
"jest-dom" // @eslint-plugin-jest-dom
], // Turn on the plugins and peer plugins
"extends": [
"airbnb", // Use the recommended rules from @eslint-config-airbnb
"airbnb-typescript", // Extends prevouos rules by rules from @eslint-config-airbnb-typescript
"plugin:react/recommended", // Extends prevouos rules by rules from @eslint-plugin-react
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended", // Extends prevouos rules by rules from @typescript-eslint/eslint-plugin
"plugin:jest/recommended", // Extends prevouos rules by recommended rules from @eslint-plugin-jest
"plugin:jest-dom/recommended" // Extends prevouos rules by recommended rules from @eslint-plugin-jest-dom
],
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"parserOptions": {
"project": "./tsconfig.json", // Source file for @typescript-eslint/parser
"sourceType": "module", // Allows for the use of imports
"createDefaultProgram": true,
"ecmaVersion": 12, // Allows for the parsing of modern ECMAScript features
"ecmaFeatures": {
"jsx": true, // Allows for the parsing of JSX
"modules": true
}
},
"rules": {
"global-require": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/jsx-no-useless-fragment": "off",
"import/prefer-default-export": "off",
"class-methods-use-this": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"optionalDependencies": false,
"peerDependencies": false
}
],
"linebreak-style": [
"error",
"unix"
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/jsx-props-no-spreading": "off",
"react/jsx-pascal-case": [
"error"
],
"react/jsx-sort-props": [
"error",
{
"noSortAlphabetically": true,
"ignoreCase": true,
"callbacksLast": true,
"shorthandLast": false,
"reservedFirst": [
"key"
]
}
],
"react/jsx-max-props-per-line": [
"error",
{
"maximum": 1,
"when": "always"
}
]
},
"ignorePatterns": [
"./node_modules/**",
"./src/**/*.cjs"
],
"settings": {
"react": {
"version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use
}
}
}