generated from baharalidurrani/material-domain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
126 lines (124 loc) · 3.65 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
116
117
118
119
120
121
122
123
124
125
126
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: "detect", // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
extends: [
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:jsx-a11y/strict",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:import/typescript",
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ["react", "jsx-a11y", "import", "@typescript-eslint"],
rules: {
// G E N E R A L
yoda: "error",
quotes: ["error", "double", { avoidEscape: true }],
"no-empty-function": "error",
"no-duplicate-imports": "error",
"no-lone-blocks": "error",
"no-implicit-coercion": "error",
"no-implied-eval": "error",
"no-script-url": "error",
"default-case": "error",
"dot-notation": "error",
"no-useless-concat": "error",
"no-unneeded-ternary": "error",
"one-var": ["error", "never"],
"no-template-curly-in-string": "error",
"prefer-template": "error",
// 'import/no-cycle': 'error',
"@typescript-eslint/no-non-null-assertion": "off",
// "no-console": [
// "warn",
// {
// allow: ["warn", "error", "info"],
// },
// ],
"prefer-destructuring": [
"error",
{
array: false,
object: true,
},
],
"no-restricted-imports": [
"error",
{
paths: [
{
name: "styled-components",
message: "Please import from styled-components/macro.",
},
],
patterns: ["!styled-components/macro"],
},
],
// T Y P E S C R I P T
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": [
"error",
{
extendDefaults: true,
types: {
"{}": false,
},
},
],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
vars: "local",
varsIgnorePattern: "^(React|e|i|it|expect)$",
argsIgnorePattern: "^(props|error|reject|response)$",
},
],
// R E A C T
// "react/jsx-no-literals": "error",
"react/jsx-uses-vars": "error",
"react/jsx-uses-react": "error",
"jsx-a11y/label-has-for": "off",
// I M P O R T
"import/newline-after-import": ["warn", { count: 1 }],
// 'import/no-cycle': 'error',
"import/order": [
"warn",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react*",
group: "external",
position: "before",
},
{
pattern: "src/**",
group: "internal",
},
],
pathGroupsExcludedImportTypes: ["react"],
"newlines-between": "never",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
};