@alexlit/config-eslint 164.3.2 → 165.0.0

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/base.js CHANGED
@@ -64,7 +64,7 @@ export const IGNORES = [
64
64
  export const base = defineConfig([
65
65
  { files: FILES, languageOptions: { globals: globals.browser } },
66
66
 
67
- // Node.js globals for commonjs/esm files
67
+ // Глобальные объекты Node.js для commonjs/esm-файлов
68
68
  { files: ['**/*.{cjs,mjs}'], languageOptions: { globals: globals.node } },
69
69
 
70
70
  { linterOptions: { reportUnusedDisableDirectives: 'error' } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "164.3.2",
3
+ "version": "165.0.0",
4
4
  "private": false,
5
5
  "description": "eslint config",
6
6
  "keywords": [
@@ -47,34 +47,34 @@
47
47
  "@eslint/js": "^10.0.1",
48
48
  "@eslint/json": "^2.1.1",
49
49
  "@intlify/eslint-plugin-vue-i18n": "^4.5.1",
50
- "@stylistic/eslint-plugin": "^5.10.0",
51
- "@tanstack/eslint-plugin-query": "^5.106.1",
52
- "@unocss/eslint-config": "^66.12.0",
50
+ "@stylistic/eslint-plugin": "^6.0.1",
51
+ "@tanstack/eslint-plugin-query": "^5.107.1",
52
+ "@unocss/eslint-config": "^66.13.0",
53
53
  "@vitest/eslint-plugin": "^1.6.28",
54
- "eslint": "^10.14.0",
54
+ "eslint": "^10.15.0",
55
55
  "eslint-config-prettier": "^10.1.8",
56
56
  "eslint-plugin-de-morgan": "^2.3.0",
57
- "eslint-plugin-import-x": "^4.17.1",
58
- "eslint-plugin-jsdoc": "^65.4.4",
59
- "eslint-plugin-perfectionist": "^5.13.0",
57
+ "eslint-plugin-import-x": "^4.18.1",
58
+ "eslint-plugin-jsdoc": "^65.4.8",
59
+ "eslint-plugin-perfectionist": "^5.14.0",
60
60
  "eslint-plugin-pinia": "^0.4.2",
61
61
  "eslint-plugin-prettier": "^5.5.7",
62
62
  "eslint-plugin-regexp": "^3.3.3",
63
63
  "eslint-plugin-sonarjs": "^4.2.2",
64
64
  "eslint-plugin-tailwindcss": "^4.4.0",
65
- "eslint-plugin-unicorn": "^79.0.0",
66
- "eslint-plugin-vue": "^10.12.0",
65
+ "eslint-plugin-unicorn": "^80.0.0",
66
+ "eslint-plugin-vue": "^10.12.1",
67
67
  "eslint-plugin-vuejs-accessibility": "^2.6.3",
68
- "eslint-plugin-zod": "^5.2.2",
68
+ "eslint-plugin-zod": "^5.3.0",
69
69
  "globals": "^17.14.0",
70
70
  "jsonc-eslint-parser": "^3.3.0",
71
71
  "typescript": "^6.0.3",
72
- "typescript-eslint": "^8.72.1",
73
- "vue-eslint-parser": "^10.4.1",
72
+ "typescript-eslint": "^8.72.2",
73
+ "vue-eslint-parser": "^10.4.2",
74
74
  "yaml-eslint-parser": "^2.1.0"
75
75
  },
76
76
  "devDependencies": {
77
- "tailwindcss": "^4.3.4"
77
+ "tailwindcss": "^4.3.5"
78
78
  },
79
79
  "publishConfig": {
80
80
  "access": "public",
@@ -43,8 +43,8 @@ export const javascript = (config = []) =>
43
43
  ],
44
44
  'no-restricted-globals': [
45
45
  'error',
46
- // `event`, `top` and `parent` are global browser properties.
47
- // Reach for `window.event` / `window.top` / `window.parent` instead.
46
+ // `event`, `top` и `parent` - глобальные свойства браузера.
47
+ // Используйте `window.event` / `window.top` / `window.parent`.
48
48
  { message: 'Use `window.event` instead.', name: 'event' },
49
49
  { message: 'Use `window.parent` instead.', name: 'parent' },
50
50
  { message: 'Use `window.top` instead.', name: 'top' },
@@ -100,7 +100,7 @@ export const javascript = (config = []) =>
100
100
  },
101
101
 
102
102
  {
103
- // Tests are allowed to log and to alert
103
+ // В тестах разрешено использовать console и alert
104
104
  files: TEST_FILES,
105
105
  rules: { 'no-alert': 'off', 'no-console': 'off' },
106
106
  },
@@ -22,13 +22,13 @@ export const perfectionist = (config = []) =>
22
22
  'warn',
23
23
  {
24
24
  customGroups: [
25
- // hash (nuxt)
25
+ // Хеш (Nuxt)
26
26
  { elementNamePattern: ['^#'], groupName: 'hash' },
27
27
 
28
28
  // @@/
29
29
  { elementNamePattern: ['^@@/'], groupName: 'double-at' },
30
30
 
31
- // universal
31
+ // Универсальные
32
32
  { elementNamePattern: ['^@/api'], groupName: 'universal-api' },
33
33
  {
34
34
  elementNamePattern: ['^@/assets'],
@@ -75,13 +75,13 @@ export const perfectionist = (config = []) =>
75
75
  'type-import',
76
76
  ['value-builtin', 'value-external'],
77
77
 
78
- // hash (nuxt)
78
+ // Хеш (Nuxt)
79
79
  'hash',
80
80
 
81
81
  // @@/
82
82
  'double-at',
83
83
 
84
- // universal
84
+ // Универсальные
85
85
  'universal-api',
86
86
  'universal-assets',
87
87
  'universal-components',
@@ -6,7 +6,7 @@ import { FILES, VUE_FILES } from '../base.js';
6
6
  import { STYLE_RULES } from '../rules/style.js';
7
7
 
8
8
  const fixes = {
9
- // fix for prettier
9
+ // Исправление для Prettier
10
10
  'vue/html-self-closing': [
11
11
  'error',
12
12
  {
@@ -49,6 +49,9 @@ export const stylistic = (config = []) =>
49
49
  beforeLineComment: false,
50
50
  },
51
51
  ],
52
+ // Новое в @stylistic 6 правило конфликтует с Prettier:
53
+ // eslint-config-prettier 10.1.8 его ещё не отключает
54
+ '@stylistic/list-style': 'off',
52
55
  '@stylistic/padding-line-between-statements': [
53
56
  'warn',
54
57
  // always
@@ -14,7 +14,8 @@ import { DATA_FILES } from '../base.js';
14
14
  */
15
15
  export const tanstackQuery = (config = []) =>
16
16
  defineConfig([
17
- // The shipped config has no `files` key, so it would also cover data files.
17
+ // В поставляемой конфигурации нет ключа `files`, поэтому она также
18
+ // затрагивала бы data-файлы.
18
19
  ...plugin.configs['flat/recommended'].map((config) => ({
19
20
  ...config,
20
21
  ignores: [...(config.ignores ?? []), ...DATA_FILES],
@@ -7,9 +7,9 @@ import { TS_RULES } from '../rules/typescript.js';
7
7
  /**
8
8
  * Type-aware правила TypeScript.
9
9
  *
10
- * Opt-in: requires a `tsconfig.json` in the project and needs type information,
11
- * which makes linting slower. Use it instead of `typescript`, not alongside
12
- * it.
10
+ * Включается вручную: требует `tsconfig.json` в проекте и информацию о типах,
11
+ * из-за чего линтинг работает медленнее. Используйте его вместо `typescript`, а
12
+ * не вместе с ним.
13
13
  *
14
14
  * @param {import('eslint').Linter.Config | import('eslint').Linter.Config[]} [config]
15
15
  *
@@ -19,15 +19,15 @@ import { TS_RULES } from '../rules/typescript.js';
19
19
  */
20
20
  export const typescriptTypeChecked = (config = []) =>
21
21
  defineConfig([
22
- // The parser is needed for every JS/TS/Vue file, not only for TypeScript ones,
23
- // otherwise `.js` files fall back to the default parser and modern syntax
24
- // (`import.meta`, top-level await) breaks.
22
+ // Парсер нужен для каждого JS/TS/Vue-файла, а не только для TypeScript,
23
+ // иначе `.js`-файлы вернутся к парсеру по умолчанию, и современный синтаксис
24
+ // (`import.meta`, top-level await) сломается.
25
25
  { ...plugin.configs.base, files: FILES },
26
26
 
27
- // Non type-aware rules - the same scope as the regular `typescript` plugin,
28
- // so `.js`/`.vue` files keep the TypeScript versions of the rules.
29
- // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
30
- // so they would also land on data files that are not JavaScript at all.
27
+ // Правила без анализа типов - та же область, что и у обычного плагина `typescript`,
28
+ // поэтому `.js`/`.vue`-файлы сохраняют TypeScript-версии правил.
29
+ // `plugin.configs.strict`/`stylistic` содержат блоки без ключа `files`,
30
+ // поэтому они также применялись бы к data-файлам, которые вообще не JavaScript.
31
31
  ...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
32
32
  (config) => ({
33
33
  ...config,
@@ -35,7 +35,7 @@ export const typescriptTypeChecked = (config = []) =>
35
35
  }),
36
36
  ),
37
37
 
38
- // Type-aware rules only make sense where the type information is available.
38
+ // Правила с анализом типов имеют смысл только там, где доступна информация о типах.
39
39
  ...plugin.configs.strictTypeChecked.map((config) => ({
40
40
  ...config,
41
41
  files: TS_FILES,
@@ -15,8 +15,8 @@ import { TS_RULES } from '../rules/typescript.js';
15
15
  */
16
16
  export const typescript = (config = []) =>
17
17
  defineConfig([
18
- // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
19
- // so they would also land on data files that are not JavaScript at all.
18
+ // `plugin.configs.strict`/`stylistic` содержат блоки без ключа `files`,
19
+ // поэтому они также применялись бы к data-файлам, которые вообще не JavaScript.
20
20
  ...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
21
21
  (config) => ({
22
22
  ...config,
@@ -27,9 +27,9 @@ export const unicorn = (config = []) =>
27
27
  'error',
28
28
  { default: 'arrow-function' },
29
29
  ],
30
- // Explicit: the default happens to be kebab case, but the intent is
31
- // worth pinning down. Applies to `.vue` components too, which is why
32
- // `vue/match-component-file-name` is kept in sync with it in `vue.js`.
30
+ // Явно: значение по умолчанию оказалось kebab case, но намерение
31
+ // стоит зафиксировать. Применяется и к `.vue`-компонентам, поэтому
32
+ // `vue/match-component-file-name` синхронизирован с этим в `vue.js`.
33
33
  'unicorn/filename-case': ['error', { case: 'kebabCase' }],
34
34
  'unicorn/iteration-fallback-style': ['error', 'guard'],
35
35
  'unicorn/name-replacements': 'off',
@@ -37,18 +37,18 @@ export const unicorn = (config = []) =>
37
37
  'unicorn/no-asterisk-prefix-in-documentation-comments': 'off',
38
38
  'unicorn/no-empty-file': 'off',
39
39
  'unicorn/no-for-each': 'off',
40
- 'unicorn/no-this-outside-of-class': 'off', // used in setters/getters
41
- 'unicorn/no-top-level-side-effects': 'off', // Vue.js specific
42
- 'unicorn/no-unused-properties': 'off', // don't respect local keys
43
- 'unicorn/prefer-dom-node-html-methods': 'off', // Safari not supports setHTML()
40
+ 'unicorn/no-this-outside-of-class': 'off', // используется в сеттерах/геттерах
41
+ 'unicorn/no-top-level-side-effects': 'off', // специфика Vue.js
42
+ 'unicorn/no-unused-properties': 'off', // не учитывает локальные ключи
43
+ 'unicorn/prefer-dom-node-html-methods': 'off', // Safari не поддерживает setHTML()
44
44
  'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
45
- 'unicorn/prefer-https': 'off', // SVG need HTTP
45
+ 'unicorn/prefer-https': 'off', // для SVG нужен HTTP
46
46
  'unicorn/prefer-import-meta-properties': 'warn',
47
- 'unicorn/prefer-iterator-concat': 'off', // ES2026 only
47
+ 'unicorn/prefer-iterator-concat': 'off', // только ES2026
48
48
  'unicorn/prefer-json-import': 'warn',
49
49
  'unicorn/prefer-module': 'warn',
50
50
  'unicorn/prefer-node-protocol': 'warn',
51
- 'unicorn/prefer-temporal': 'off', // ES2026 only
51
+ 'unicorn/prefer-temporal': 'off', // только ES2026
52
52
  'unicorn/prefer-type-literal-last': 'off', // perfectionist/sort-intersection-types
53
53
  'unicorn/prefer-uint8array-hex': 'warn',
54
54
  'unicorn/relative-url-style': ['error', 'always'],
@@ -58,9 +58,9 @@ export const unicorn = (config = []) =>
58
58
  { files: ['**/.*'], rules: { 'unicorn/no-null': 'off' } },
59
59
  { files: DTS_FILES, rules: { 'unicorn/prefer-export-from': 'off' } },
60
60
  {
61
- // `null` is part of the type contract in Vue.js SFC:
62
- // `ref<Type | null>(null)` is the idiomatic way to declare an initially
63
- // empty reactive value. Everywhere else `null` remains an error.
61
+ // `null` - часть контракта типов в Vue.js SFC:
62
+ // `ref<Type | null>(null)` - идиоматичный способ объявить изначально
63
+ // пустое реактивное значение. Везде ещё `null` остаётся ошибкой.
64
64
  files: VUE_FILES,
65
65
  rules: {
66
66
  'unicorn/no-null': 'off',
package/plugins/vue.js CHANGED
@@ -31,7 +31,7 @@ export const vue = (config = []) =>
31
31
  ],
32
32
  'no-restricted-syntax': [
33
33
  'error',
34
- // Merge the shared list, do not replace it
34
+ // Объединяем общий список, а не заменяем его
35
35
  ...NO_RESTRICTED_SYNTAX,
36
36
  {
37
37
  message:
@@ -87,12 +87,12 @@ export const vue = (config = []) =>
87
87
  'defineOptions',
88
88
  'defineSlots',
89
89
 
90
- // nuxt (can use props)
90
+ // Nuxt (могут использоваться props)
91
91
  'createUseAsyncData',
92
92
  'createUseFetch',
93
93
 
94
94
  'onPrehydrate',
95
- // /nuxt (can use props)
95
+ // /Nuxt (могут использоваться props)
96
96
 
97
97
  // nuxi-ui
98
98
  'defineLocale',
@@ -124,10 +124,10 @@ export const vue = (config = []) =>
124
124
  svg: 'always',
125
125
  },
126
126
  ],
127
- // Keep in sync with `unicorn/filename-case` in `unicorn.js`:
128
- // components live in kebab-case files, so the component name is
129
- // derived from a kebab-case file name instead of being required to be
130
- // PascalCase in the file name itself.
127
+ // Синхронизировано с `unicorn/filename-case` в `unicorn.js`:
128
+ // компоненты лежат в kebab-case-файлах, поэтому имя компонента
129
+ // выводится из имени kebab-case-файла, а не требуется
130
+ // PascalCase в самом имени файла.
131
131
  'vue/match-component-file-name': [
132
132
  'error',
133
133
  { extensions: ['vue'], shouldMatchCase: false },