@alexlit/lint-kit 214.4.0 → 215.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.
Files changed (155) hide show
  1. package/README.md +27 -22
  2. package/eslint.config.js +23 -56
  3. package/lint-staged.config.js +2 -2
  4. package/linthtml.config.js +2 -2
  5. package/package.json +3 -2
  6. package/packages/config-eslint/README.md +156 -106
  7. package/packages/config-eslint/base.js +5 -3
  8. package/packages/config-eslint/index.d.ts +112 -0
  9. package/packages/config-eslint/index.js +79 -23
  10. package/packages/config-eslint/package.json +19 -16
  11. package/packages/config-eslint/plugins/de-morgan.js +9 -4
  12. package/packages/config-eslint/plugins/import-x.js +50 -37
  13. package/packages/config-eslint/plugins/javascript.js +96 -85
  14. package/packages/config-eslint/plugins/jsdoc.js +24 -17
  15. package/packages/config-eslint/plugins/json.js +31 -24
  16. package/packages/config-eslint/plugins/perfectionist.js +108 -95
  17. package/packages/config-eslint/plugins/pinia.js +17 -10
  18. package/packages/config-eslint/plugins/prettier.js +24 -10
  19. package/packages/config-eslint/plugins/regexp.js +16 -9
  20. package/packages/config-eslint/plugins/sonar.js +19 -12
  21. package/packages/config-eslint/plugins/stylistic.js +107 -100
  22. package/packages/config-eslint/plugins/tailwindcss.js +17 -6
  23. package/packages/config-eslint/plugins/tanstack-query.js +16 -9
  24. package/packages/config-eslint/plugins/typescript-type-checked.js +38 -33
  25. package/packages/config-eslint/plugins/typescript.js +23 -14
  26. package/packages/config-eslint/plugins/unicorn.js +73 -64
  27. package/packages/config-eslint/plugins/unocss.js +12 -5
  28. package/packages/config-eslint/plugins/vitest.js +20 -13
  29. package/packages/config-eslint/plugins/vue-accessibility.js +22 -13
  30. package/packages/config-eslint/plugins/vue-i18n.js +38 -31
  31. package/packages/config-eslint/plugins/vue.js +255 -242
  32. package/packages/config-eslint/plugins/zod.js +17 -10
  33. package/packages/config-eslint/rules/typescript.js +1 -1
  34. package/packages/config-hooks/README.md +119 -37
  35. package/packages/config-hooks/index.d.ts +19 -0
  36. package/packages/config-hooks/lint-staged.js +8 -6
  37. package/packages/config-hooks/package.json +3 -1
  38. package/packages/config-htmllint/README.md +50 -22
  39. package/packages/config-htmllint/index.d.ts +13 -0
  40. package/packages/config-htmllint/index.js +15 -7
  41. package/packages/config-htmllint/package.json +4 -2
  42. package/packages/config-markdownlint/README.md +40 -5
  43. package/packages/config-markdownlint/index.json +0 -2
  44. package/packages/config-markdownlint/package.json +1 -1
  45. package/packages/config-npmlint/README.md +48 -5
  46. package/packages/config-npmlint/package.json +3 -3
  47. package/packages/config-prettier/README.md +106 -23
  48. package/packages/config-prettier/index.d.ts +92 -0
  49. package/packages/config-prettier/index.js +60 -74
  50. package/packages/config-prettier/package.json +4 -3
  51. package/packages/config-prettier/plugins/jsdoc.js +12 -3
  52. package/packages/config-prettier/plugins/mdc.js +12 -3
  53. package/packages/config-prettier/plugins/packagejson.js +12 -3
  54. package/packages/config-prettier/plugins/php.js +12 -3
  55. package/packages/config-prettier/plugins/pug.js +12 -3
  56. package/packages/config-prettier/plugins/ruby.js +10 -10
  57. package/packages/config-prettier/plugins/sh.js +12 -3
  58. package/packages/config-prettier/plugins/solidity.js +12 -3
  59. package/packages/config-prettier/plugins/sort-json.js +12 -3
  60. package/packages/config-prettier/plugins/sql.js +12 -3
  61. package/packages/config-prettier/plugins/tailwindcss.js +12 -3
  62. package/packages/config-prettier/plugins/xml.js +12 -3
  63. package/packages/config-stylelint/README.md +131 -44
  64. package/packages/config-stylelint/index.d.ts +52 -0
  65. package/packages/config-stylelint/index.js +169 -165
  66. package/packages/config-stylelint/package.json +3 -1
  67. package/packages/config-stylelint/plugins/a11y.js +24 -11
  68. package/packages/config-stylelint/plugins/bem.js +10 -3
  69. package/packages/config-stylelint/plugins/color-format.js +14 -4
  70. package/packages/config-stylelint/plugins/declaration-block-no-ignored-properties.js +15 -4
  71. package/packages/config-stylelint/plugins/gamut.js +12 -4
  72. package/packages/config-stylelint/plugins/high-performance-animation.js +12 -3
  73. package/packages/config-stylelint/plugins/logical-css.js +10 -3
  74. package/packages/config-stylelint/plugins/media-use-custom-media.js +12 -4
  75. package/packages/config-stylelint/plugins/no-indistinguishable-colors.js +15 -4
  76. package/packages/config-stylelint/plugins/no-nested-media.js +12 -4
  77. package/packages/config-stylelint/plugins/no-unresolved-module.js +12 -3
  78. package/packages/config-stylelint/plugins/no-unsupported-browser-features.js +12 -3
  79. package/packages/config-stylelint/plugins/order.js +13 -3
  80. package/packages/config-stylelint/plugins/prettier.js +12 -4
  81. package/packages/config-stylelint/plugins/scss.js +13 -3
  82. package/packages/config-stylelint/plugins/selector-no-empty.js +12 -4
  83. package/packages/config-stylelint/plugins/use-nesting.js +15 -4
  84. package/packages/config-stylelint/plugins/vue.js +11 -2
  85. package/prettier.config.js +15 -7
  86. package/scripts/semver.sh +3 -3
  87. package/stylelint.config.js +25 -11
  88. package/packages/config-eslint/_legacy/LICENSE +0 -20
  89. package/packages/config-eslint/_legacy/README.md +0 -48
  90. package/packages/config-eslint/_legacy/constants/allow-boolean-property-list.js +0 -38
  91. package/packages/config-eslint/_legacy/constants/boolean-prefixes.js +0 -11
  92. package/packages/config-eslint/_legacy/constants/english-verbs.js +0 -3368
  93. package/packages/config-eslint/_legacy/dictionaries/index.js +0 -467
  94. package/packages/config-eslint/_legacy/dictionaries/programming/bash.js +0 -25
  95. package/packages/config-eslint/_legacy/dictionaries/programming/django.js +0 -2345
  96. package/packages/config-eslint/_legacy/dictionaries/programming/elixir.js +0 -64
  97. package/packages/config-eslint/_legacy/dictionaries/programming/go.js +0 -7748
  98. package/packages/config-eslint/_legacy/dictionaries/programming/java.js +0 -33527
  99. package/packages/config-eslint/_legacy/dictionaries/programming/latex.js +0 -675
  100. package/packages/config-eslint/_legacy/dictionaries/programming/lua.js +0 -394
  101. package/packages/config-eslint/_legacy/dictionaries/programming/php.js +0 -9788
  102. package/packages/config-eslint/_legacy/dictionaries/programming/python.js +0 -367
  103. package/packages/config-eslint/_legacy/dictionaries/programming/ruby.js +0 -357
  104. package/packages/config-eslint/_legacy/dictionaries/programming/rust.js +0 -115
  105. package/packages/config-eslint/_legacy/dictionaries/programming/scala.js +0 -2755
  106. package/packages/config-eslint/_legacy/dictionaries/specialized/html-symbol-entities.js +0 -1118
  107. package/packages/config-eslint/_legacy/dictionaries/specialized/lorem-ipsum.js +0 -359
  108. package/packages/config-eslint/_legacy/index.js +0 -12
  109. package/packages/config-eslint/_legacy/legacy.js +0 -3
  110. package/packages/config-eslint/_legacy/package.json +0 -97
  111. package/packages/config-eslint/_legacy/plugins/array-func.js +0 -20
  112. package/packages/config-eslint/_legacy/plugins/compat.js +0 -7
  113. package/packages/config-eslint/_legacy/plugins/decorator-position.js +0 -15
  114. package/packages/config-eslint/_legacy/plugins/eslint-comments.js +0 -9
  115. package/packages/config-eslint/_legacy/plugins/etc.js +0 -13
  116. package/packages/config-eslint/_legacy/plugins/ext.js +0 -12
  117. package/packages/config-eslint/_legacy/plugins/filenames.js +0 -38
  118. package/packages/config-eslint/_legacy/plugins/import.js +0 -133
  119. package/packages/config-eslint/_legacy/plugins/jsdoc.js +0 -32
  120. package/packages/config-eslint/_legacy/plugins/jsx-a11y.js +0 -5
  121. package/packages/config-eslint/_legacy/plugins/lit-a11y.js +0 -5
  122. package/packages/config-eslint/_legacy/plugins/lit.js +0 -9
  123. package/packages/config-eslint/_legacy/plugins/more.js +0 -17
  124. package/packages/config-eslint/_legacy/plugins/no-await-in-promise.js +0 -5
  125. package/packages/config-eslint/_legacy/plugins/no-constructor-bind.js +0 -8
  126. package/packages/config-eslint/_legacy/plugins/no-explicit-type-exports.js +0 -7
  127. package/packages/config-eslint/_legacy/plugins/no-loops.js +0 -7
  128. package/packages/config-eslint/_legacy/plugins/no-secrets.js +0 -12
  129. package/packages/config-eslint/_legacy/plugins/no-use-extend-native.js +0 -5
  130. package/packages/config-eslint/_legacy/plugins/node.js +0 -5
  131. package/packages/config-eslint/_legacy/plugins/prettier.js +0 -24
  132. package/packages/config-eslint/_legacy/plugins/promise.js +0 -10
  133. package/packages/config-eslint/_legacy/plugins/regexp.js +0 -7
  134. package/packages/config-eslint/_legacy/plugins/security.js +0 -10
  135. package/packages/config-eslint/_legacy/plugins/simple-import-sort.js +0 -7
  136. package/packages/config-eslint/_legacy/plugins/sonar.js +0 -5
  137. package/packages/config-eslint/_legacy/plugins/sort-class-members.js +0 -298
  138. package/packages/config-eslint/_legacy/plugins/sort-destructure-keys.js +0 -10
  139. package/packages/config-eslint/_legacy/plugins/sort-keys-fix.js +0 -7
  140. package/packages/config-eslint/_legacy/plugins/spellcheck.js +0 -9
  141. package/packages/config-eslint/_legacy/plugins/sql.js +0 -26
  142. package/packages/config-eslint/_legacy/plugins/tanstack-query.js +0 -4
  143. package/packages/config-eslint/_legacy/plugins/testing-library.js +0 -9
  144. package/packages/config-eslint/_legacy/plugins/typescript-sort-keys.js +0 -5
  145. package/packages/config-eslint/_legacy/plugins/typescript.js +0 -157
  146. package/packages/config-eslint/_legacy/plugins/unicorn.js +0 -70
  147. package/packages/config-eslint/_legacy/plugins/unused-imports.js +0 -17
  148. package/packages/config-eslint/_legacy/plugins/vitest.js +0 -16
  149. package/packages/config-eslint/_legacy/plugins/vue-i18n.js +0 -34
  150. package/packages/config-eslint/_legacy/plugins/vue.js +0 -291
  151. package/packages/config-eslint/_legacy/plugins/vuejs-accessibility.js +0 -20
  152. package/packages/config-eslint/_legacy/plugins/wc.js +0 -5
  153. package/packages/config-eslint/_legacy/plugins/write-good-comments.js +0 -7
  154. package/packages/config-eslint/_legacy/utils/create-config.js +0 -377
  155. package/packages/config-eslint/_legacy/utils/extend-spell-checker.js +0 -23
@@ -5,46 +5,51 @@ import { DATA_FILES, FILES, TEST_FILES, TS_FILES } from '../base.js';
5
5
  import { TS_RULES } from '../rules/typescript.js';
6
6
 
7
7
  /**
8
- * Type-aware TypeScript config.
8
+ * Type-aware правила TypeScript.
9
9
  *
10
10
  * Opt-in: requires a `tsconfig.json` in the project and needs type information,
11
11
  * which makes linting slower. Use it instead of `typescript`, not alongside
12
12
  * it.
13
13
  *
14
+ * @returns {import('eslint').Linter.Config[]}
15
+ *
14
16
  * @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
15
17
  */
16
- export const typescriptTypeChecked = defineConfig([
17
- // The parser is needed for every JS/TS/Vue file, not only for TypeScript ones,
18
- // otherwise `.js` files fall back to the default parser and modern syntax
19
- // (`import.meta`, top-level await) breaks.
20
- { ...plugin.configs.base, files: FILES },
18
+ export const typescriptTypeChecked = () =>
19
+ defineConfig([
20
+ // The parser is needed for every JS/TS/Vue file, not only for TypeScript ones,
21
+ // otherwise `.js` files fall back to the default parser and modern syntax
22
+ // (`import.meta`, top-level await) breaks.
23
+ { ...plugin.configs.base, files: FILES },
21
24
 
22
- // Non type-aware rules — the same scope as the regular `typescript` plugin,
23
- // so `.js`/`.vue` files keep the TypeScript versions of the rules.
24
- // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
25
- // so they would also land on data files that are not JavaScript at all.
26
- ...[...plugin.configs.strict, ...plugin.configs.stylistic].map((config) => ({
27
- ...config,
28
- ignores: [...(config.ignores ?? []), ...DATA_FILES],
29
- })),
25
+ // Non type-aware rules - the same scope as the regular `typescript` plugin,
26
+ // so `.js`/`.vue` files keep the TypeScript versions of the rules.
27
+ // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
28
+ // so they would also land on data files that are not JavaScript at all.
29
+ ...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
30
+ (config) => ({
31
+ ...config,
32
+ ignores: [...(config.ignores ?? []), ...DATA_FILES],
33
+ }),
34
+ ),
30
35
 
31
- // Type-aware rules only make sense where the type information is available.
32
- ...plugin.configs.strictTypeChecked.map((config) => ({
33
- ...config,
34
- files: TS_FILES,
35
- })),
36
- ...plugin.configs.stylisticTypeChecked.map((config) => ({
37
- ...config,
38
- files: TS_FILES,
39
- })),
36
+ // Type-aware rules only make sense where the type information is available.
37
+ ...plugin.configs.strictTypeChecked.map((config) => ({
38
+ ...config,
39
+ files: TS_FILES,
40
+ })),
41
+ ...plugin.configs.stylisticTypeChecked.map((config) => ({
42
+ ...config,
43
+ files: TS_FILES,
44
+ })),
40
45
 
41
- {
42
- files: TS_FILES,
43
- languageOptions: { parserOptions: { projectService: true } },
44
- rules: TS_RULES,
45
- },
46
- {
47
- files: TEST_FILES,
48
- rules: { '@typescript-eslint/no-empty-function': 'off' },
49
- },
50
- ]);
46
+ {
47
+ files: TS_FILES,
48
+ languageOptions: { parserOptions: { projectService: true } },
49
+ rules: TS_RULES,
50
+ },
51
+ {
52
+ files: TEST_FILES,
53
+ rules: { '@typescript-eslint/no-empty-function': 'off' },
54
+ },
55
+ ]);
@@ -4,18 +4,27 @@ import plugin from 'typescript-eslint';
4
4
  import { DATA_FILES, FILES, TEST_FILES } from '../base.js';
5
5
  import { TS_RULES } from '../rules/typescript.js';
6
6
 
7
- /** @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) */
8
- export const typescript = defineConfig([
9
- // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
10
- // so they would also land on data files that are not JavaScript at all.
11
- ...[...plugin.configs.strict, ...plugin.configs.stylistic].map((config) => ({
12
- ...config,
13
- ignores: [...(config.ignores ?? []), ...DATA_FILES],
14
- })),
7
+ /**
8
+ * Правила TypeScript без анализа типов.
9
+ *
10
+ * @returns {import('eslint').Linter.Config[]}
11
+ *
12
+ * @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
13
+ */
14
+ export const typescript = () =>
15
+ defineConfig([
16
+ // `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
17
+ // so they would also land on data files that are not JavaScript at all.
18
+ ...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
19
+ (config) => ({
20
+ ...config,
21
+ ignores: [...(config.ignores ?? []), ...DATA_FILES],
22
+ }),
23
+ ),
15
24
 
16
- { files: FILES, rules: TS_RULES },
17
- {
18
- files: TEST_FILES,
19
- rules: { '@typescript-eslint/no-empty-function': 'off' },
20
- },
21
- ]);
25
+ { files: FILES, rules: TS_RULES },
26
+ {
27
+ files: TEST_FILES,
28
+ rules: { '@typescript-eslint/no-empty-function': 'off' },
29
+ },
30
+ ]);
@@ -3,70 +3,79 @@ import { defineConfig } from 'eslint/config';
3
3
 
4
4
  import { DTS_FILES, FILES, VUE_FILES } from '../base.js';
5
5
 
6
- /** @see [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) */
7
- export const unicorn = defineConfig([
8
- { ...plugin.configs.recommended, files: FILES },
9
- {
10
- files: FILES,
11
- rules: {
12
- 'unicorn/comment-content': ['warn'],
13
- 'unicorn/consistent-function-scoping': [
14
- 'error',
15
- { checkArrowFunctions: false },
16
- ],
17
- 'unicorn/consistent-function-style': [
18
- 'error',
19
- { default: 'arrow-function' },
6
+ /**
7
+ * Правила unicorn.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
12
+ */
13
+ export const unicorn = () =>
14
+ defineConfig([
15
+ { ...plugin.configs.recommended, files: FILES },
16
+ {
17
+ files: FILES,
18
+ rules: {
19
+ 'unicorn/comment-content': ['warn'],
20
+ 'unicorn/consistent-function-scoping': [
21
+ 'error',
22
+ { checkArrowFunctions: false },
23
+ ],
24
+ 'unicorn/consistent-function-style': [
25
+ 'error',
26
+ { default: 'arrow-function' },
27
+ ],
28
+ // Explicit: the default happens to be kebab case, but the intent is
29
+ // worth pinning down. Applies to `.vue` components too, which is why
30
+ // `vue/match-component-file-name` is kept in sync with it in `vue.js`.
31
+ 'unicorn/filename-case': ['error', { case: 'kebabCase' }],
32
+ 'unicorn/iteration-fallback-style': ['error', 'guard'],
33
+ 'unicorn/name-replacements': 'off',
34
+ 'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
35
+ 'unicorn/no-asterisk-prefix-in-documentation-comments': 'off',
36
+ 'unicorn/no-empty-file': 'off',
37
+ 'unicorn/no-for-each': 'off',
38
+ 'unicorn/no-this-outside-of-class': 'off', // used in setters/getters
39
+ 'unicorn/no-top-level-side-effects': 'off', // Vue.js specific
40
+ 'unicorn/no-unused-properties': 'off', // don't respect local keys
41
+ 'unicorn/prefer-dom-node-html-methods': 'off', // Safari not supports setHTML()
42
+ 'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
43
+ 'unicorn/prefer-https': 'off', // SVG need HTTP
44
+ 'unicorn/prefer-import-meta-properties': 'warn',
45
+ 'unicorn/prefer-iterator-concat': 'off', // ES2026 only
46
+ 'unicorn/prefer-json-import': 'warn',
47
+ 'unicorn/prefer-module': 'warn',
48
+ 'unicorn/prefer-node-protocol': 'warn',
49
+ 'unicorn/prefer-temporal': 'off', // ES2026 only
50
+ 'unicorn/prefer-type-literal-last': 'off', // perfectionist/sort-intersection-types
51
+ 'unicorn/prefer-uint8array-hex': 'warn',
52
+ 'unicorn/relative-url-style': ['error', 'always'],
53
+ 'unicorn/single-line-block-comment-style': 'off',
54
+ },
55
+ },
56
+ { files: ['**/.*'], rules: { 'unicorn/no-null': 'off' } },
57
+ { files: DTS_FILES, rules: { 'unicorn/prefer-export-from': 'off' } },
58
+ {
59
+ // `null` is part of the type contract in Vue.js SFC:
60
+ // `ref<Type | null>(null)` is the idiomatic way to declare an initially
61
+ // empty reactive value. Everywhere else `null` remains an error.
62
+ files: VUE_FILES,
63
+ rules: { 'unicorn/no-null': 'off' },
64
+ },
65
+ {
66
+ files: [
67
+ '**/*.{api,endpoints,fixtures,schemas,service,spec,test}.{js,ts}',
20
68
  ],
21
- // Explicit: the default happens to be kebab case, but the intent is
22
- // worth pinning down. Applies to `.vue` components too, which is why
23
- // `vue/match-component-file-name` is kept in sync with it in `vue.js`.
24
- 'unicorn/filename-case': ['error', { case: 'kebabCase' }],
25
- 'unicorn/iteration-fallback-style': ['error', 'guard'],
26
- 'unicorn/name-replacements': 'off',
27
- 'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
28
- 'unicorn/no-asterisk-prefix-in-documentation-comments': 'off',
29
- 'unicorn/no-empty-file': 'off',
30
- 'unicorn/no-for-each': 'off',
31
- 'unicorn/no-this-outside-of-class': 'off', // used in setters/getters
32
- 'unicorn/no-top-level-side-effects': 'off', // Vue.js specific
33
- 'unicorn/no-unused-properties': 'off', // don't respect local keys
34
- 'unicorn/prefer-dom-node-html-methods': 'off', // Safari not supports setHTML()
35
- 'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
36
- 'unicorn/prefer-https': 'off', // SVG need HTTP
37
- 'unicorn/prefer-import-meta-properties': 'warn',
38
- 'unicorn/prefer-iterator-concat': 'off', // ES2026 only
39
- 'unicorn/prefer-json-import': 'warn',
40
- 'unicorn/prefer-module': 'warn',
41
- 'unicorn/prefer-node-protocol': 'warn',
42
- 'unicorn/prefer-temporal': 'off', // ES2026 only
43
- 'unicorn/prefer-type-literal-last': 'off', // perfectionist/sort-intersection-types
44
- 'unicorn/prefer-uint8array-hex': 'warn',
45
- 'unicorn/relative-url-style': ['error', 'always'],
46
- 'unicorn/single-line-block-comment-style': 'off',
69
+ rules: {
70
+ 'unicorn/max-nested-calls': 'off',
71
+ 'unicorn/no-keyword-prefix': 'off',
72
+ 'unicorn/no-null': 'off',
73
+ 'unicorn/no-object-as-default-parameter': 'off',
74
+ 'unicorn/no-useless-undefined': 'off',
75
+ },
47
76
  },
48
- },
49
- { files: ['**/.*'], rules: { 'unicorn/no-null': 'off' } },
50
- { files: DTS_FILES, rules: { 'unicorn/prefer-export-from': 'off' } },
51
- {
52
- // `null` is part of the type contract in Vue.js SFC:
53
- // `ref<Type | null>(null)` is the idiomatic way to declare an initially
54
- // empty reactive value. Everywhere else `null` remains an error.
55
- files: VUE_FILES,
56
- rules: { 'unicorn/no-null': 'off' },
57
- },
58
- {
59
- files: ['**/*.{api,endpoints,fixtures,schemas,service,spec,test}.{js,ts}'],
60
- rules: {
61
- 'unicorn/max-nested-calls': 'off',
62
- 'unicorn/no-keyword-prefix': 'off',
63
- 'unicorn/no-null': 'off',
64
- 'unicorn/no-object-as-default-parameter': 'off',
65
- 'unicorn/no-useless-undefined': 'off',
77
+ {
78
+ files: ['**/temp/**/*.vue'],
79
+ rules: { 'unicorn/name-replacements': 'off' },
66
80
  },
67
- },
68
- {
69
- files: ['**/temp/**/*.vue'],
70
- rules: { 'unicorn/name-replacements': 'off' },
71
- },
72
- ]);
81
+ ]);
@@ -3,8 +3,15 @@ import { defineConfig } from 'eslint/config';
3
3
 
4
4
  import { FILES } from '../base.js';
5
5
 
6
- /** @see [@unocss/eslint-config](https://unocss.dev/integrations/eslint) */
7
- export const unocss = defineConfig([
8
- { files: FILES, ...plugin },
9
- { files: FILES, rules: { 'unocss/order-attributify': 'off' } },
10
- ]);
6
+ /**
7
+ * Правила для UnoCSS.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [@unocss/eslint-config](https://unocss.dev/integrations/eslint)
12
+ */
13
+ export const unocss = () =>
14
+ defineConfig([
15
+ { files: FILES, ...plugin },
16
+ { files: FILES, rules: { 'unocss/order-attributify': 'off' } },
17
+ ]);
@@ -3,18 +3,25 @@ import { defineConfig } from 'eslint/config';
3
3
 
4
4
  import { TEST_FILES } from '../base.js';
5
5
 
6
- /** @see [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) */
7
- export const vitest = defineConfig([
8
- {
9
- files: TEST_FILES,
10
- plugins: { vitest: plugin },
11
- rules: {
12
- ...plugin.configs.recommended.rules,
6
+ /**
7
+ * Правила для тестов Vitest.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest)
12
+ */
13
+ export const vitest = () =>
14
+ defineConfig([
15
+ {
16
+ files: TEST_FILES,
17
+ plugins: { vitest: plugin },
18
+ rules: {
19
+ ...plugin.configs.recommended.rules,
13
20
 
14
- 'vitest/no-conditional-in-test': 'off',
15
- 'vitest/no-conditional-tests': 'off',
16
- 'vitest/no-hooks': 'off',
17
- 'vitest/require-to-throw-message': 'off',
21
+ 'vitest/no-conditional-in-test': 'off',
22
+ 'vitest/no-conditional-tests': 'off',
23
+ 'vitest/no-hooks': 'off',
24
+ 'vitest/require-to-throw-message': 'off',
25
+ },
18
26
  },
19
- },
20
- ]);
27
+ ]);
@@ -1,18 +1,27 @@
1
1
  import plugin from 'eslint-plugin-vuejs-accessibility';
2
2
  import { defineConfig } from 'eslint/config';
3
3
 
4
- /** @see [eslint-plugin-vuejs-accessibility](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/) */
5
- export const vueAccessibility = defineConfig([
6
- ...plugin.configs['flat/recommended'],
4
+ import { VUE_FILES } from '../base.js';
7
5
 
8
- {
9
- files: ['**/*.vue'],
10
- rules: {
11
- 'vuejs-accessibility/label-has-for': [
12
- 'warn',
13
- { allowChildren: true, required: { some: ['nesting', 'id'] } },
14
- ],
15
- 'vuejs-accessibility/no-autofocus': ['warn', { ignoreNonDOM: true }],
6
+ /**
7
+ * Правила доступности Vue.js-компонентов.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [eslint-plugin-vuejs-accessibility](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/)
12
+ */
13
+ export const vueAccessibility = () =>
14
+ defineConfig([
15
+ ...plugin.configs['flat/recommended'],
16
+
17
+ {
18
+ files: VUE_FILES,
19
+ rules: {
20
+ 'vuejs-accessibility/label-has-for': [
21
+ 'warn',
22
+ { allowChildren: true, required: { some: ['nesting', 'id'] } },
23
+ ],
24
+ 'vuejs-accessibility/no-autofocus': ['warn', { ignoreNonDOM: true }],
25
+ },
16
26
  },
17
- },
18
- ]);
27
+ ]);
@@ -1,39 +1,46 @@
1
1
  import plugin from '@intlify/eslint-plugin-vue-i18n';
2
2
  import { defineConfig } from 'eslint/config';
3
3
 
4
- import { DATA_FILES } from '../base.js';
4
+ import { DATA_FILES, VUE_FILES } from '../base.js';
5
5
 
6
- /** @see [eslint-plugin-vue-i18n](https://eslint-plugin-vue-i18n.intlify.dev/) */
7
- export const vueI18n = defineConfig([
8
- ...plugin.configs['flat/recommended'].map((config) => ({
9
- ...config,
10
- ignores: [...(config.ignores ?? []), ...DATA_FILES],
11
- })),
6
+ /**
7
+ * Правила для Vue.js I18n.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [eslint-plugin-vue-i18n](https://eslint-plugin-vue-i18n.intlify.dev/)
12
+ */
13
+ export const vueI18n = () =>
14
+ defineConfig([
15
+ ...plugin.configs['flat/recommended'].map((config) => ({
16
+ ...config,
17
+ ignores: [...(config.ignores ?? []), ...DATA_FILES],
18
+ })),
12
19
 
13
- {
14
- files: ['**/*.vue'],
15
- rules: {
16
- '@intlify/vue-i18n/key-format-style': [
17
- 'error',
18
- 'snake_case',
19
- { allowArray: false },
20
- ],
21
- '@intlify/vue-i18n/no-duplicate-keys-in-locale': [
22
- 'error',
23
- { ignoreI18nBlock: false },
24
- ],
25
- '@intlify/vue-i18n/no-dynamic-keys': 'warn',
26
- '@intlify/vue-i18n/no-raw-text': 'off',
27
- '@intlify/vue-i18n/no-unused-keys': 'warn',
28
- '@intlify/vue-i18n/prefer-sfc-lang-attr': 'error',
20
+ {
21
+ files: VUE_FILES,
22
+ rules: {
23
+ '@intlify/vue-i18n/key-format-style': [
24
+ 'error',
25
+ 'snake_case',
26
+ { allowArray: false },
27
+ ],
28
+ '@intlify/vue-i18n/no-duplicate-keys-in-locale': [
29
+ 'error',
30
+ { ignoreI18nBlock: false },
31
+ ],
32
+ '@intlify/vue-i18n/no-dynamic-keys': 'warn',
33
+ '@intlify/vue-i18n/no-raw-text': 'off',
34
+ '@intlify/vue-i18n/no-unused-keys': 'warn',
35
+ '@intlify/vue-i18n/prefer-sfc-lang-attr': 'error',
36
+ },
29
37
  },
30
- },
31
- {
32
- settings: {
33
- 'vue-i18n': {
34
- localeDir: './**/locales/*.{json,json5,yaml,yml}',
35
- messageSyntaxVersion: '^9.0.0',
38
+ {
39
+ settings: {
40
+ 'vue-i18n': {
41
+ localeDir: './**/locales/*.{json,json5,yaml,yml}',
42
+ messageSyntaxVersion: '^9.0.0',
43
+ },
36
44
  },
37
45
  },
38
- },
39
- ]);
46
+ ]);