@dubium/eslint-config 1.0.7 → 1.0.9

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/base.js CHANGED
@@ -398,7 +398,7 @@ export const base = {
398
398
  * Requires atomic updates of asynchronous variables
399
399
  * Ссылка: https://eslint.org/docs/latest/rules/require-atomic-updates
400
400
  */
401
- "require-atomic-updates": error,
401
+ "require-atomic-updates": "error",
402
402
 
403
403
  /**
404
404
  * Требует использования метода isNaN() для проверки на NaN
@@ -421,13 +421,6 @@ export const base = {
421
421
  */
422
422
  "class-methods-use-this": ["warn"],
423
423
 
424
- /**
425
- * Ограничивает цикломатическую сложность функций
426
- * Limits the cyclomatic complexity of functions
427
- * Ссылка: https://eslint.org/docs/latest/rules/complexity
428
- */
429
- complexity: ["warn", { max: 3 }],
430
-
431
424
  /**
432
425
  * Требует согласованного возврата значений из функций
433
426
  * Requires consistent return values from functions
package/config/react.js CHANGED
@@ -179,33 +179,6 @@ export const react = {
179
179
  "never", // "never" — запрещает писать `prop={true}`, оставляя просто `prop`
180
180
  ],
181
181
 
182
- /**
183
- * Требует или запрещает пробелы между дочерними JSX-элементами для улучшения читаемости
184
- * Enforces or forbids spaces between JSX child elements for readability
185
- * Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
186
- */
187
- "react/jsx-child-element-spacing": [
188
- "warn",
189
- {
190
- allowMultiline: true, // разрешает пробелы и переносы строк между элементами
191
- before: true, // требует пробел перед дочерним элементом
192
- after: true, // требует пробел после дочернего элемента
193
- },
194
- ],
195
-
196
- /**
197
- * Контролирует расположение закрывающей скобки JSX-элементов
198
- * Controls the location of the closing bracket for JSX elements
199
- * Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
200
- */
201
- "react/jsx-closing-bracket-location": [
202
- "error",
203
- {
204
- selfClosing: "line-aligned", // для самозакрывающихся тегов — на той же линии, что и последний проп
205
- multiline: "line-aligned", // для многострочных — на отдельной линии, выровненной по открывающему тегу
206
- },
207
- ],
208
-
209
182
  /**
210
183
  * Контролирует расположение закрывающего тега JSX-элементов
211
184
  * Enforces the location of the closing tag in multiline JSX elements
@@ -226,19 +199,6 @@ export const react = {
226
199
  },
227
200
  ],
228
201
 
229
- /**
230
- * Контролирует переносы строк внутри фигурных скобок в JSX
231
- * Enforces consistent line breaks inside JSX curly braces
232
- * Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
233
- */
234
- "react/jsx-curly-newline": [
235
- "error",
236
- {
237
- multiline: "require", // требует переносы строк внутри {} если содержимое многострочное
238
- singleline: "forbid", // запрещает переносы строк внутри {} если содержимое в одну строку
239
- },
240
- ],
241
-
242
202
  /**
243
203
  * Контролирует пробелы внутри фигурных скобок в JSX (например, { value })
244
204
  * Enforces consistent spacing inside JSX curly braces
@@ -303,7 +263,7 @@ export const react = {
303
263
  eventHandlerPrefix: "handle", // префикс для функций-обработчиков, например handleClick
304
264
  eventHandlerPropPrefix: "on", // префикс для пропов с обработчиками, например onClick
305
265
  checkLocalVariables: true, // проверять локальные переменные с функциями-обработчиками
306
- checkInlineFunction: true, // проверять анонимные функции в пропсах
266
+ checkInlineFunction: false, // проверять анонимные функции в пропсах
307
267
  },
308
268
  ],
309
269
 
@@ -333,21 +293,6 @@ export const react = {
333
293
  },
334
294
  ],
335
295
 
336
- /**
337
- * Запрещает использование inline-функций и bind в JSX пропсах для оптимизации производительности
338
- * Disallows usage of bind() or inline functions in JSX props to avoid unnecessary re-renders
339
- * Ссылка: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
340
- */
341
- "react/jsx-no-bind": [
342
- "warn",
343
- {
344
- ignoreRefs: true, // игнорировать ref колбэки
345
- allowArrowFunctions: false, // запрещать стрелочные функции в пропсах
346
- allowBind: false, // запрещать .bind() в пропсах
347
- ignoreDOMComponents: true, // игнорировать DOM-элементы (<div>, <button> и т.п.)
348
- },
349
- ],
350
-
351
296
  /**
352
297
  * Запрещает использовать текстовые комментарии как узлы в JSX, чтобы избежать неожиданных рендеров
353
298
  * Disallows comments as text nodes in JSX to prevent rendering issues
@@ -377,7 +322,7 @@ export const react = {
377
322
  "react/jsx-no-leaked-render": [
378
323
  "warn",
379
324
  {
380
- validStrategies: ["ternary", "logical", "coerce"], // допустимые способы безопасного рендера
325
+ validStrategies: ["ternary", "coerce"],
381
326
  },
382
327
  ],
383
328
 
@@ -8,10 +8,6 @@ export const typescript = {
8
8
 
9
9
  languageOptions: {
10
10
  parser: tsParser,
11
- parserOptions: {
12
- project: "./tsconfig.json",
13
- tsconfigRootDir: process.cwd(),
14
- },
15
11
  },
16
12
 
17
13
  plugins: {
@@ -19,6 +15,12 @@ export const typescript = {
19
15
  },
20
16
 
21
17
  rules: {
18
+ /**
19
+ * Запрещает объявление неиспользуемых переменных
20
+ * Disallows unused variables
21
+ * Ссылка: https://eslint.org/docs/latest/rules/no-unused-vars
22
+ */
23
+ "no-unused-vars": "off",
22
24
  "@typescript-eslint/no-explicit-any": "warn",
23
25
  "@typescript-eslint/consistent-type-imports": "error",
24
26
  "@typescript-eslint/no-unused-vars": ["warn"],
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@dubium/eslint-config",
3
3
  "private": false,
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./config/index.js",
8
7
  "./base": "./config/base.js",
9
8
  "./react": "./config/react.js",
10
9
  "./jsx-a11y": "./config/jsx-a11y.js",
package/config/index.js DELETED
@@ -1,4 +0,0 @@
1
- export { base } from "./base.js";
2
- export { react } from "./react.js";
3
- export { jsxA11y } from "./jsx-a11y";
4
- export { typescript } from "./typescript.js";