forked from devfolioco/react-otp-input
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
153 lines (144 loc) · 4.04 KB
/
.eslintrc.json
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
"env": {
"es2020": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"react-app",
"prettier",
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": { "extensions": [".js", ".mjs", ".cjs"] },
"typescript": {}
}
},
"plugins": ["@typescript-eslint", "import"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"react/prop-types": "off",
"react/jsx-key": "error",
"no-console": 1,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": false }
],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"import/newline-after-import": "error",
"import/no-duplicates": "error",
// Enforce import order
"import/order": [
2,
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
},
{
"pattern": "@+(symbols)",
"group": "internal"
},
{
"pattern": "@+(api|components|compositions|directives|enums|interfaces|layouts|modules|services|utils|views|hooks)/**",
"group": "internal"
},
{
"pattern": "@/**",
"group": "internal"
},
{
"pattern": "*.scss",
"group": "index",
"patternOptions": { "matchBase": true }
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
// Imports should come first
"import/first": "error",
// Other import rules
"import/no-mutable-exports": "error",
// Allow unresolved imports
"import/no-unresolved": "off",
"semi": 0,
// "quotes": 0,
// "indent": 0,
"space-before-function-paren": 0,
"arrow-parens": 0,
"comma-dangle": 0,
"keyword-spacing": 0,
"no-multiple-empty-lines": 0,
"no-trailing-spaces": 0,
"unicorn/number-literal-case": 0,
"unicorn/template-indent": 0,
"generator-star-spacing": 0,
"space-infix-ops": 0,
"comma-spacing": 0,
"brace-style": 0,
"space-in-parens": 0,
"space-before-blocks": 0,
"semi-spacing": 0,
"object-property-newline": 0,
"no-multi-spaces": 0,
"key-spacing": 0,
"eol-last": 0,
"func-call-spacing": 0,
"comma-style": 0,
// Disable some unnecessary or conflicting rules
"no-use-before-define": "off",
"unicorn/prevent-abbreviations": 0,
"unicorn/no-await-expression-member": 0,
"unicorn/no-useless-undefined": 0,
"unicorn/no-array-push-push": 0,
"unicorn/filename-case": 0,
"camelcase": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-empty-interface": 0,
// Prefer const over let
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
// No single if in an "else" block
"no-lonely-if": "error",
// Force curly braces for control flow,
// including if blocks with a single statement
"curly": ["error", "all"],
// No async function without await
"require-await": "error",
// Force dot notation when possible
"dot-notation": "error",
// Force object shorthand where possible
"object-shorthand": "error",
// No useless destructuring/importing/exporting renames
"no-useless-rename": "error"
}
}