@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,254 +5,267 @@ import typescript from 'typescript-eslint';
5
5
  import { DATA_FILES, TEST_FILES, VUE_FILES } from '../base.js';
6
6
  import { NO_RESTRICTED_SYNTAX } from '../rules/restricted-syntax.js';
7
7
 
8
- /** @see [eslint-plugin-vue](https://eslint.vuejs.org/rules/) */
9
- export const vue = defineConfig([
10
- ...plugin.configs['flat/recommended'].map((config) => ({
11
- ...config,
12
- ignores: [...(config.ignores ?? []), ...DATA_FILES],
13
- })),
8
+ /**
9
+ * Правила для Vue.js.
10
+ *
11
+ * @returns {import('eslint').Linter.Config[]}
12
+ *
13
+ * @see [eslint-plugin-vue](https://eslint.vuejs.org/rules/)
14
+ */
15
+ export const vue = () =>
16
+ defineConfig([
17
+ ...plugin.configs['flat/recommended'].map((config) => ({
18
+ ...config,
19
+ ignores: [...(config.ignores ?? []), ...DATA_FILES],
20
+ })),
14
21
 
15
- {
16
- files: VUE_FILES,
17
- languageOptions: { parserOptions: { parser: typescript.parser } },
18
- rules: {
19
- '@typescript-eslint/no-empty-object-type': [
20
- 'error',
21
- { allowWithName: 'Props$' },
22
- ],
23
- 'no-restricted-syntax': [
24
- 'error',
25
- // Merge the shared list, do not replace it
26
- ...NO_RESTRICTED_SYNTAX,
27
- {
28
- message:
29
- 'Запрещено использовать имя "Props". Используйте именованный формат, например: <ИмяКомпонента>Props.',
30
- selector:
31
- "TSInterfaceDeclaration[id.name='Props'], TSTypeAliasDeclaration[id.name='Props']",
32
- },
33
- {
34
- message:
35
- 'При вызове useRoute() переменная должна называться строго "$route" (const $route = useRoute()).',
36
- selector:
37
- 'VariableDeclarator[init.callee.name="useRoute"][id.name!="$route"]',
38
- },
39
- {
40
- message:
41
- 'При вызове useRouter() переменная должна называться строго "$router" (const $router = useRouter()).',
42
- selector:
43
- 'VariableDeclarator[init.callee.name="useRouter"][id.name!="$router"]',
44
- },
45
- ],
46
- 'vue/attributes-order': ['error', { alphabetical: true }],
47
- 'vue/block-lang': [
48
- 'error',
49
- { script: { lang: 'ts' }, style: {}, template: {} },
50
- ],
51
- 'vue/block-order': ['error', { order: ['script', 'template', 'style'] }],
52
- 'vue/component-api-style': ['error', ['script-setup']],
53
- 'vue/component-definition-name-casing': ['error', 'PascalCase'],
54
- 'vue/component-name-in-template-casing': [
55
- 'error',
56
- 'PascalCase',
57
- {
58
- ignores: [String.raw`/^[A-Z][a-zA-Z]*\.[A-Z][a-zA-Z]*$/`],
59
- registeredComponentsOnly: false,
60
- },
61
- ],
62
- 'vue/component-options-name-casing': ['error', 'PascalCase'],
63
- 'vue/custom-event-name-casing': ['error', 'camelCase', { ignores: [] }],
64
- 'vue/define-emits-declaration': ['error'],
65
- 'vue/define-macros-order': [
66
- 'error',
67
- {
68
- defineExposeLast: true,
69
- order: [
70
- 'definePageMeta', // nuxt
22
+ {
23
+ files: VUE_FILES,
24
+ languageOptions: { parserOptions: { parser: typescript.parser } },
25
+ rules: {
26
+ '@typescript-eslint/no-empty-object-type': [
27
+ 'error',
28
+ { allowWithName: 'Props$' },
29
+ ],
30
+ 'no-restricted-syntax': [
31
+ 'error',
32
+ // Merge the shared list, do not replace it
33
+ ...NO_RESTRICTED_SYNTAX,
34
+ {
35
+ message:
36
+ 'Запрещено использовать имя "Props". Используйте именованный формат, например: <ИмяКомпонента>Props.',
37
+ selector:
38
+ "TSInterfaceDeclaration[id.name='Props'], TSTypeAliasDeclaration[id.name='Props']",
39
+ },
40
+ {
41
+ message:
42
+ 'При вызове useRoute() переменная должна называться строго "$route" (const $route = useRoute()).',
43
+ selector:
44
+ 'VariableDeclarator[init.callee.name="useRoute"][id.name!="$route"]',
45
+ },
46
+ {
47
+ message:
48
+ 'При вызове useRouter() переменная должна называться строго "$router" (const $router = useRouter()).',
49
+ selector:
50
+ 'VariableDeclarator[init.callee.name="useRouter"][id.name!="$router"]',
51
+ },
52
+ ],
53
+ 'vue/attributes-order': ['error', { alphabetical: true }],
54
+ 'vue/block-lang': [
55
+ 'error',
56
+ { script: { lang: 'ts' }, style: {}, template: {} },
57
+ ],
58
+ 'vue/block-order': [
59
+ 'error',
60
+ { order: ['script', 'template', 'style'] },
61
+ ],
62
+ 'vue/component-api-style': ['error', ['script-setup']],
63
+ 'vue/component-definition-name-casing': ['error', 'PascalCase'],
64
+ 'vue/component-name-in-template-casing': [
65
+ 'error',
66
+ 'PascalCase',
67
+ {
68
+ ignores: [String.raw`/^[A-Z][a-zA-Z]*\.[A-Z][a-zA-Z]*$/`],
69
+ registeredComponentsOnly: false,
70
+ },
71
+ ],
72
+ 'vue/component-options-name-casing': ['error', 'PascalCase'],
73
+ 'vue/custom-event-name-casing': ['error', 'camelCase', { ignores: [] }],
74
+ 'vue/define-emits-declaration': ['error'],
75
+ 'vue/define-macros-order': [
76
+ 'error',
77
+ {
78
+ defineExposeLast: true,
79
+ order: [
80
+ 'definePageMeta', // nuxt
71
81
 
72
- 'defineProps',
73
- 'defineModel',
74
- 'defineEmits',
75
- 'defineOptions',
76
- 'defineSlots',
82
+ 'defineProps',
83
+ 'defineModel',
84
+ 'defineEmits',
85
+ 'defineOptions',
86
+ 'defineSlots',
77
87
 
78
- // nuxt (can use props)
79
- 'createUseAsyncData',
80
- 'createUseFetch',
88
+ // nuxt (can use props)
89
+ 'createUseAsyncData',
90
+ 'createUseFetch',
81
91
 
82
- 'onPrehydrate',
83
- // /nuxt (can use props)
92
+ 'onPrehydrate',
93
+ // /nuxt (can use props)
84
94
 
85
- // nuxi-ui
86
- 'defineLocale',
87
- 'defineShortcuts',
88
- 'extendLocale',
89
- 'extractShortcuts',
90
- // /nuxi-ui
91
- ],
92
- },
93
- ],
94
- 'vue/define-props-declaration': ['error'],
95
- 'vue/define-props-destructuring': [
96
- 'warn',
97
- { destructure: 'only-when-assigned' },
98
- ],
99
- 'vue/dot-notation': ['error'],
100
- 'vue/enforce-style-attribute': ['error', { allow: ['scoped'] }],
101
- 'vue/eqeqeq': ['error'],
102
- 'vue/html-button-has-type': ['error'],
103
- 'vue/html-comment-content-newline': ['warn'],
104
- 'vue/html-comment-content-spacing': ['warn'],
105
- 'vue/html-comment-indent': ['warn'],
106
- 'vue/html-end-tags': ['error'],
107
- 'vue/html-self-closing': [
108
- 'error',
109
- {
110
- html: { component: 'always', normal: 'never', void: 'always' },
111
- math: 'always',
112
- svg: 'always',
113
- },
114
- ],
115
- // Keep in sync with `unicorn/filename-case` in `unicorn.js`:
116
- // components live in kebab-case files, so the component name is
117
- // derived from a kebab-case file name instead of being required to be
118
- // PascalCase in the file name itself.
119
- 'vue/match-component-file-name': [
120
- 'error',
121
- { extensions: ['vue'], shouldMatchCase: false },
122
- ],
123
- 'vue/match-component-import-name': ['error'],
124
- 'vue/max-attributes-per-line': ['error', { singleline: 3 }],
125
- 'vue/max-lines-per-block': [
126
- 'warn',
127
- { script: 500, skipBlankLines: true, style: 500, template: 500 },
128
- ],
129
- 'vue/new-line-between-multi-line-property': 'off',
130
- 'vue/next-tick-style': ['error', 'promise'],
131
- 'vue/no-child-content': ['error'],
132
- 'vue/no-console': ['error'],
133
- 'vue/no-custom-modifiers-on-v-model': 'off',
134
- 'vue/no-deprecated-delete-set': ['error'],
135
- 'vue/no-deprecated-model-definition': ['error'],
136
- 'vue/no-deprecated-scope-attribute': ['error'],
137
- 'vue/no-deprecated-slot-attribute': ['error'],
138
- 'vue/no-deprecated-slot-scope-attribute': ['error'],
139
- 'vue/no-duplicate-attr-inheritance': ['error'],
140
- 'vue/no-duplicate-class-names': ['error'],
141
- 'vue/no-empty-component-block': ['error'],
142
- 'vue/no-import-compiler-macros': ['error'],
143
- 'vue/no-irregular-whitespace': ['error'],
144
- 'vue/no-loss-of-precision': ['error'],
145
- 'vue/no-multiple-objects-in-class': ['error'],
146
- 'vue/no-multiple-template-root': 'off',
147
- 'vue/no-negated-condition': ['error'],
148
- 'vue/no-negated-v-if-condition': ['error'],
149
- 'vue/no-parsing-error': ['error'],
150
- 'vue/no-potential-component-option-typo': ['error'],
151
- 'vue/no-ref-object-reactivity-loss': ['error'],
152
- 'vue/no-required-prop-with-default': ['error', { autofix: true }],
153
- 'vue/no-reserved-component-names': [
154
- 'error',
155
- {
156
- disallowVue3BuiltInComponents: true,
157
- disallowVueBuiltInComponents: true,
158
- },
159
- ],
160
- 'vue/no-restricted-component-names': ['error'],
161
- 'vue/no-restricted-component-options': ['error'],
162
- 'vue/no-restricted-props': ['error'],
163
- 'vue/no-root-v-if': ['error'],
164
- 'vue/no-setup-props-reactivity-loss': ['error'],
165
- 'vue/no-shadow-native-events': ['error'],
166
- 'vue/no-static-inline-styles': ['error', { allowBinding: true }],
167
- 'vue/no-this-in-before-route-enter': ['error'],
168
- 'vue/no-undef-components': ['error'],
169
- 'vue/no-undef-directives': ['error'],
170
- 'vue/no-unsupported-features': ['error'],
171
- 'vue/no-unused-components': ['error'],
172
- 'vue/no-unused-emit-declarations': ['error'],
173
- 'vue/no-unused-properties': [
174
- 'error',
175
- { groups: ['inject', 'props', 'asyncData', 'computed', 'methods'] },
176
- ],
177
- 'vue/no-unused-refs': ['error'],
178
- 'vue/no-use-computed-property-like-method': ['error'],
179
- 'vue/no-use-v-else-with-v-for': ['warn'],
180
- 'vue/no-use-v-if-with-v-for': ['warn', { allowUsingIterationVar: true }],
181
- 'vue/no-useless-mustaches': ['error'],
182
- 'vue/no-useless-template-attributes': ['error'],
183
- 'vue/no-useless-v-bind': ['error'],
184
- 'vue/no-v-for-template-key': 'off',
185
- 'vue/no-v-html': ['error', { ignorePattern: '^html' }],
186
- 'vue/no-v-model-argument': 'off',
187
- 'vue/no-v-text': ['error'],
188
- 'vue/no-v-text-v-html-on-component': ['error'],
189
- 'vue/object-shorthand': ['error'],
190
- 'vue/order-in-components': 'off',
191
- 'vue/padding-line-between-blocks': ['error'],
192
- 'vue/padding-line-between-tags': [
193
- 'error',
194
- [{ blankLine: 'always', next: '*', prev: '*' }],
195
- ],
196
- 'vue/padding-lines-in-component-definition': [
197
- 'error',
198
- { groupSingleLineProperties: true },
199
- ],
200
- 'vue/prefer-define-options': ['error'],
201
- 'vue/prefer-prop-type-boolean-first': ['error'],
202
- 'vue/prefer-separate-static-class': ['error'],
203
- 'vue/prefer-single-event-payload': ['error'],
204
- 'vue/prefer-true-attribute-shorthand': ['error'],
205
- 'vue/prefer-use-template-ref': ['error'],
206
- 'vue/prefer-v-model': ['error'],
207
- 'vue/quote-props': ['error', 'as-needed'],
208
- 'vue/require-direct-export': 'off',
209
- 'vue/require-explicit-slots': ['warn'],
210
- 'vue/require-macro-variable-name': [
211
- 'error',
212
- {
213
- defineEmits: '$emit',
214
- defineProps: '$props',
215
- defineSlots: '$slots',
216
- useAttrs: '$attrs',
217
- useSlots: '$slots',
218
- },
219
- ],
220
- 'vue/require-typed-object-prop': ['error'],
221
- 'vue/require-typed-ref': ['error'],
222
- 'vue/slot-name-casing': ['error', 'kebab-case'],
223
- 'vue/sort-keys': 'off',
224
- 'vue/static-class-names-order': ['warn'],
225
- 'vue/this-in-template': ['error', 'never'],
226
- 'vue/v-bind-style': [
227
- 'error',
228
- 'shorthand',
229
- { sameNameShorthand: 'always' },
230
- ],
231
- 'vue/v-for-delimiter-style': ['error'],
232
- 'vue/v-if-else-key': ['error'],
233
- 'vue/v-on-event-hyphenation': ['error'],
234
- 'vue/v-on-handler-style': ['error', 'inline-function'],
235
- 'vue/valid-define-options': ['error'],
236
- 'vue/valid-next-tick': ['error'],
237
- 'vue/valid-v-bind-sync': ['error'],
238
- 'vue/valid-v-slot': ['error'],
95
+ // nuxi-ui
96
+ 'defineLocale',
97
+ 'defineShortcuts',
98
+ 'extendLocale',
99
+ 'extractShortcuts',
100
+ // /nuxi-ui
101
+ ],
102
+ },
103
+ ],
104
+ 'vue/define-props-declaration': ['error'],
105
+ 'vue/define-props-destructuring': [
106
+ 'warn',
107
+ { destructure: 'only-when-assigned' },
108
+ ],
109
+ 'vue/dot-notation': ['error'],
110
+ 'vue/enforce-style-attribute': ['error', { allow: ['scoped'] }],
111
+ 'vue/eqeqeq': ['error'],
112
+ 'vue/html-button-has-type': ['error'],
113
+ 'vue/html-comment-content-newline': ['warn'],
114
+ 'vue/html-comment-content-spacing': ['warn'],
115
+ 'vue/html-comment-indent': ['warn'],
116
+ 'vue/html-end-tags': ['error'],
117
+ 'vue/html-self-closing': [
118
+ 'error',
119
+ {
120
+ html: { component: 'always', normal: 'never', void: 'always' },
121
+ math: 'always',
122
+ svg: 'always',
123
+ },
124
+ ],
125
+ // Keep in sync with `unicorn/filename-case` in `unicorn.js`:
126
+ // components live in kebab-case files, so the component name is
127
+ // derived from a kebab-case file name instead of being required to be
128
+ // PascalCase in the file name itself.
129
+ 'vue/match-component-file-name': [
130
+ 'error',
131
+ { extensions: ['vue'], shouldMatchCase: false },
132
+ ],
133
+ 'vue/match-component-import-name': ['error'],
134
+ 'vue/max-attributes-per-line': ['error', { singleline: 3 }],
135
+ 'vue/max-lines-per-block': [
136
+ 'warn',
137
+ { script: 500, skipBlankLines: true, style: 500, template: 500 },
138
+ ],
139
+ 'vue/new-line-between-multi-line-property': 'off',
140
+ 'vue/next-tick-style': ['error', 'promise'],
141
+ 'vue/no-child-content': ['error'],
142
+ 'vue/no-console': ['error'],
143
+ 'vue/no-custom-modifiers-on-v-model': 'off',
144
+ 'vue/no-deprecated-delete-set': ['error'],
145
+ 'vue/no-deprecated-model-definition': ['error'],
146
+ 'vue/no-deprecated-scope-attribute': ['error'],
147
+ 'vue/no-deprecated-slot-attribute': ['error'],
148
+ 'vue/no-deprecated-slot-scope-attribute': ['error'],
149
+ 'vue/no-duplicate-attr-inheritance': ['error'],
150
+ 'vue/no-duplicate-class-names': ['error'],
151
+ 'vue/no-empty-component-block': ['error'],
152
+ 'vue/no-import-compiler-macros': ['error'],
153
+ 'vue/no-irregular-whitespace': ['error'],
154
+ 'vue/no-loss-of-precision': ['error'],
155
+ 'vue/no-multiple-objects-in-class': ['error'],
156
+ 'vue/no-multiple-template-root': 'off',
157
+ 'vue/no-negated-condition': ['error'],
158
+ 'vue/no-negated-v-if-condition': ['error'],
159
+ 'vue/no-parsing-error': ['error'],
160
+ 'vue/no-potential-component-option-typo': ['error'],
161
+ 'vue/no-ref-object-reactivity-loss': ['error'],
162
+ 'vue/no-required-prop-with-default': ['error', { autofix: true }],
163
+ 'vue/no-reserved-component-names': [
164
+ 'error',
165
+ {
166
+ disallowVue3BuiltInComponents: true,
167
+ disallowVueBuiltInComponents: true,
168
+ },
169
+ ],
170
+ 'vue/no-restricted-component-names': ['error'],
171
+ 'vue/no-restricted-component-options': ['error'],
172
+ 'vue/no-restricted-props': ['error'],
173
+ 'vue/no-root-v-if': ['error'],
174
+ 'vue/no-setup-props-reactivity-loss': ['error'],
175
+ 'vue/no-shadow-native-events': ['error'],
176
+ 'vue/no-static-inline-styles': ['error', { allowBinding: true }],
177
+ 'vue/no-this-in-before-route-enter': ['error'],
178
+ 'vue/no-undef-components': ['error'],
179
+ 'vue/no-undef-directives': ['error'],
180
+ 'vue/no-unsupported-features': ['error'],
181
+ 'vue/no-unused-components': ['error'],
182
+ 'vue/no-unused-emit-declarations': ['error'],
183
+ 'vue/no-unused-properties': [
184
+ 'error',
185
+ { groups: ['inject', 'props', 'asyncData', 'computed', 'methods'] },
186
+ ],
187
+ 'vue/no-unused-refs': ['error'],
188
+ 'vue/no-use-computed-property-like-method': ['error'],
189
+ 'vue/no-use-v-else-with-v-for': ['warn'],
190
+ 'vue/no-use-v-if-with-v-for': [
191
+ 'warn',
192
+ { allowUsingIterationVar: true },
193
+ ],
194
+ 'vue/no-useless-mustaches': ['error'],
195
+ 'vue/no-useless-template-attributes': ['error'],
196
+ 'vue/no-useless-v-bind': ['error'],
197
+ 'vue/no-v-for-template-key': 'off',
198
+ 'vue/no-v-html': ['error', { ignorePattern: '^html' }],
199
+ 'vue/no-v-model-argument': 'off',
200
+ 'vue/no-v-text': ['error'],
201
+ 'vue/no-v-text-v-html-on-component': ['error'],
202
+ 'vue/object-shorthand': ['error'],
203
+ 'vue/order-in-components': 'off',
204
+ 'vue/padding-line-between-blocks': ['error'],
205
+ 'vue/padding-line-between-tags': [
206
+ 'error',
207
+ [{ blankLine: 'always', next: '*', prev: '*' }],
208
+ ],
209
+ 'vue/padding-lines-in-component-definition': [
210
+ 'error',
211
+ { groupSingleLineProperties: true },
212
+ ],
213
+ 'vue/prefer-define-options': ['error'],
214
+ 'vue/prefer-prop-type-boolean-first': ['error'],
215
+ 'vue/prefer-separate-static-class': ['error'],
216
+ 'vue/prefer-single-event-payload': ['error'],
217
+ 'vue/prefer-true-attribute-shorthand': ['error'],
218
+ 'vue/prefer-use-template-ref': ['error'],
219
+ 'vue/prefer-v-model': ['error'],
220
+ 'vue/quote-props': ['error', 'as-needed'],
221
+ 'vue/require-direct-export': 'off',
222
+ 'vue/require-explicit-slots': ['warn'],
223
+ 'vue/require-macro-variable-name': [
224
+ 'error',
225
+ {
226
+ defineEmits: '$emit',
227
+ defineProps: '$props',
228
+ defineSlots: '$slots',
229
+ useAttrs: '$attrs',
230
+ useSlots: '$slots',
231
+ },
232
+ ],
233
+ 'vue/require-typed-object-prop': ['error'],
234
+ 'vue/require-typed-ref': ['error'],
235
+ 'vue/slot-name-casing': ['error', 'kebab-case'],
236
+ 'vue/sort-keys': 'off',
237
+ 'vue/static-class-names-order': ['warn'],
238
+ 'vue/this-in-template': ['error', 'never'],
239
+ 'vue/v-bind-style': [
240
+ 'error',
241
+ 'shorthand',
242
+ { sameNameShorthand: 'always' },
243
+ ],
244
+ 'vue/v-for-delimiter-style': ['error'],
245
+ 'vue/v-if-else-key': ['error'],
246
+ 'vue/v-on-event-hyphenation': ['error'],
247
+ 'vue/v-on-handler-style': ['error', 'inline-function'],
248
+ 'vue/valid-define-options': ['error'],
249
+ 'vue/valid-next-tick': ['error'],
250
+ 'vue/valid-v-bind-sync': ['error'],
251
+ 'vue/valid-v-slot': ['error'],
252
+ },
239
253
  },
240
- },
241
254
 
242
- {
243
- files: ['**/*.ts', '**/*.js', '**/*.cjs', '**/*.mjs'],
244
- rules: { 'vue/order-in-components': 'off' },
245
- },
255
+ {
256
+ files: ['**/*.ts', '**/*.js', '**/*.cjs', '**/*.mjs'],
257
+ rules: { 'vue/order-in-components': 'off' },
258
+ },
246
259
 
247
- {
248
- files: [
249
- '**/app/*.vue',
250
- '**/src/*.vue',
251
- '**/layouts/**/*.vue',
252
- '**/pages/**/*.vue',
253
- ],
254
- rules: { 'vue/multi-word-component-names': 'off' },
255
- },
260
+ {
261
+ files: [
262
+ '**/app/*.vue',
263
+ '**/src/*.vue',
264
+ '**/layouts/**/*.vue',
265
+ '**/pages/**/*.vue',
266
+ ],
267
+ rules: { 'vue/multi-word-component-names': 'off' },
268
+ },
256
269
 
257
- { files: TEST_FILES, rules: { 'vue/one-component-per-file': 'off' } },
258
- ]);
270
+ { files: TEST_FILES, rules: { 'vue/one-component-per-file': 'off' } },
271
+ ]);
@@ -3,14 +3,21 @@ import { defineConfig } from 'eslint/config';
3
3
 
4
4
  import { FILES } from '../base.js';
5
5
 
6
- /** @see [eslint-plugin-zod](https://github.com/marcalexiei/eslint-zod/tree/main/plugins/eslint-plugin-zod) */
7
- export const zod = defineConfig([
8
- {
9
- ...plugin.configs.recommended,
10
- files: FILES,
11
- rules: {
12
- ...plugin.configs.recommended.rules,
13
- 'zod/consistent-import': ['error', { syntax: 'named' }],
6
+ /**
7
+ * Правила для Zod-схем.
8
+ *
9
+ * @returns {import('eslint').Linter.Config[]}
10
+ *
11
+ * @see [eslint-plugin-zod](https://github.com/marcalexiei/eslint-zod/tree/main/plugins/eslint-plugin-zod)
12
+ */
13
+ export const zod = () =>
14
+ defineConfig([
15
+ {
16
+ ...plugin.configs.recommended,
17
+ files: FILES,
18
+ rules: {
19
+ ...plugin.configs.recommended.rules,
20
+ 'zod/consistent-import': ['error', { syntax: 'named' }],
21
+ },
14
22
  },
15
- },
16
- ]);
23
+ ]);
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Shared TypeScript rules.
5
5
  *
6
- * `format: null` disables the format check for destructured variables — their
6
+ * `format: null` disables the format check for destructured variables - their
7
7
  * names may be arbitrary.
8
8
  */
9
9
  export const TS_RULES = {