@dubium/eslint-config 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/react.js +10 -29
- package/package.json +1 -1
package/config/react.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import pluginReact from "eslint-plugin-react"
|
|
2
|
-
import pluginReactRefresh from "eslint-plugin-react-refresh"
|
|
3
|
-
import pluginReactHooks from "eslint-plugin-react-hooks"
|
|
1
|
+
import pluginReact from "eslint-plugin-react"
|
|
2
|
+
import pluginReactRefresh from "eslint-plugin-react-refresh"
|
|
3
|
+
import pluginReactHooks from "eslint-plugin-react-hooks"
|
|
4
4
|
|
|
5
5
|
export const react = {
|
|
6
6
|
name: "@dubium/eslint-config/react",
|
|
7
7
|
|
|
8
|
-
files: ["**/*.{jsx,js,ts,tsx}"],
|
|
8
|
+
files: [ "**/*.{jsx,js,ts,tsx}" ],
|
|
9
9
|
|
|
10
10
|
languageOptions: {
|
|
11
11
|
parserOptions: {
|
|
@@ -106,18 +106,6 @@ export const react = {
|
|
|
106
106
|
*/
|
|
107
107
|
"react/display-name": "warn",
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* Запрещает использовать определённые пропы в компонентах React
|
|
111
|
-
* Forbids specified props on components to enforce code conventions or avoid bugs
|
|
112
|
-
* Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
|
|
113
|
-
*/
|
|
114
|
-
"react/forbid-component-props": [
|
|
115
|
-
"error",
|
|
116
|
-
{
|
|
117
|
-
forbid: ["style", "className"], // пример — запрещаем использовать style и className
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
|
|
121
109
|
/**
|
|
122
110
|
* Запрещает использование определённых пропов на DOM-элементах (например, <div>, <input>)
|
|
123
111
|
* Forbids specified props on DOM nodes to enforce code style or prevent errors
|
|
@@ -126,7 +114,7 @@ export const react = {
|
|
|
126
114
|
"react/forbid-dom-props": [
|
|
127
115
|
"warn",
|
|
128
116
|
{
|
|
129
|
-
forbid: ["style"], // пример — запрещаем inline-стили на DOM-элементах
|
|
117
|
+
forbid: [ "style" ], // пример — запрещаем inline-стили на DOM-элементах
|
|
130
118
|
},
|
|
131
119
|
],
|
|
132
120
|
|
|
@@ -230,7 +218,7 @@ export const react = {
|
|
|
230
218
|
"react/jsx-filename-extension": [
|
|
231
219
|
"error",
|
|
232
220
|
{
|
|
233
|
-
extensions: [".tsx", ".jsx"], // разрешённые расширения файлов с JSX
|
|
221
|
+
extensions: [ ".tsx", ".jsx" ], // разрешённые расширения файлов с JSX
|
|
234
222
|
},
|
|
235
223
|
],
|
|
236
224
|
|
|
@@ -250,7 +238,7 @@ export const react = {
|
|
|
250
238
|
* Enforces shorthand <>...</> for fragments, but allows <React.Fragment> with props
|
|
251
239
|
* Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
252
240
|
*/
|
|
253
|
-
"react/jsx-fragments": ["error", "syntax"],
|
|
241
|
+
"react/jsx-fragments": [ "error", "syntax" ],
|
|
254
242
|
|
|
255
243
|
/**
|
|
256
244
|
* Требует, чтобы имена обработчиков событий в JSX соответствовали определённым шаблонам
|
|
@@ -274,13 +262,6 @@ export const react = {
|
|
|
274
262
|
*/
|
|
275
263
|
"react/jsx-key": "error",
|
|
276
264
|
|
|
277
|
-
/**
|
|
278
|
-
* Ограничивает максимальную глубину вложенности JSX-элементов в дереве
|
|
279
|
-
* Limits the maximum depth of JSX elements to improve readability and maintainability
|
|
280
|
-
* Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
|
|
281
|
-
*/
|
|
282
|
-
"react/jsx-max-depth": ["warn", { max: 4 }],
|
|
283
|
-
|
|
284
265
|
/**
|
|
285
266
|
* Требует соблюдать перенос строки вокруг JSX-элементов для улучшения читаемости
|
|
286
267
|
* Enforces newlines around JSX elements to improve code readability
|
|
@@ -322,7 +303,7 @@ export const react = {
|
|
|
322
303
|
"react/jsx-no-leaked-render": [
|
|
323
304
|
"warn",
|
|
324
305
|
{
|
|
325
|
-
validStrategies: ["ternary", "coerce"],
|
|
306
|
+
validStrategies: [ "ternary", "coerce" ],
|
|
326
307
|
},
|
|
327
308
|
],
|
|
328
309
|
|
|
@@ -545,6 +526,6 @@ export const react = {
|
|
|
545
526
|
* Ensures only components are exported for React Fast Refresh
|
|
546
527
|
* Ссылка: https://github.com/react-refresh/eslint-plugin-react-refresh
|
|
547
528
|
*/
|
|
548
|
-
"react-refresh/only-export-components": ["warn"],
|
|
529
|
+
"react-refresh/only-export-components": [ "warn" ],
|
|
549
530
|
},
|
|
550
|
-
}
|
|
531
|
+
}
|