@alexlit/config-eslint 153.3.0 → 153.5.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/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v153.5.0
5
+
6
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.4.0...v153.5.0)
7
+
8
+ ### 🏡 Chore
9
+
10
+ - **@alexlit/lint-kit:** Bump version ([361cb371](https://github.com/alex-lit/lint-kit/commit/361cb371))
11
+
12
+ ### ❤️ Contributors
13
+
14
+ - Alexey Litovchenko ([@alex-lit](https://github.com/alex-lit))
15
+
16
+ ## v153.4.0
17
+
18
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.3.0...v153.4.0)
19
+
20
+ ### 🏡 Chore
21
+
22
+ - **@alexlit/lint-kit:** Bump version ([85b0b3a2](https://github.com/alex-lit/lint-kit/commit/85b0b3a2))
23
+ - **@alexlit/config-hooks:** Bump version ([d1e01056](https://github.com/alex-lit/lint-kit/commit/d1e01056))
24
+
25
+ ### ❤️ Contributors
26
+
27
+ - Alexey Litovchenko ([@alex-lit](https://github.com/alex-lit))
28
+
4
29
  ## v153.3.0
5
30
 
6
31
  [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.2.1...v153.3.0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "153.3.0",
3
+ "version": "153.5.0",
4
4
  "private": false,
5
5
  "description": "Sharable ESLint configuration",
6
6
  "keywords": [
@@ -45,17 +45,17 @@
45
45
  "@intlify/eslint-plugin-vue-i18n": "^4.5.1",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@tanstack/eslint-plugin-query": "^5.101.4",
48
- "@unocss/eslint-config": "^66.7.5",
48
+ "@unocss/eslint-config": "^66.8.0",
49
49
  "@vitest/eslint-plugin": "^1.6.27",
50
50
  "eslint": "^10.8.1",
51
51
  "eslint-config-prettier": "^10.1.8",
52
- "eslint-plugin-jsdoc": "^64.2.0",
52
+ "eslint-plugin-jsdoc": "^64.2.1",
53
53
  "eslint-plugin-perfectionist": "^5.10.1",
54
54
  "eslint-plugin-pinia": "^0.4.2",
55
55
  "eslint-plugin-prettier": "^5.5.6",
56
56
  "eslint-plugin-regexp": "^3.2.0",
57
57
  "eslint-plugin-sonarjs": "^4.2.0",
58
- "eslint-plugin-tailwindcss": "^4.2.0",
58
+ "eslint-plugin-tailwindcss": "^4.3.0",
59
59
  "eslint-plugin-unicorn": "^73.0.0",
60
60
  "eslint-plugin-vue": "^10.10.0",
61
61
  "eslint-plugin-vuejs-accessibility": "^2.6.0",
@@ -5,14 +5,93 @@ import { FILES } from '../presets/base.js';
5
5
 
6
6
  /** @see [eslint-plugin-perfectionist](https://perfectionist.dev) */
7
7
  export const perfectionist = defineConfig([
8
- { files: FILES, ...plugin.configs['recommended-natural'] },
8
+ { ...plugin.configs['recommended-natural'], files: FILES },
9
9
  {
10
10
  files: FILES,
11
11
  rules: {
12
12
  'perfectionist/sort-imports': [
13
13
  'warn',
14
14
  {
15
- internalPattern: ['^#.*', '^~/.*', '^~~/.*', '^@/.*', '^@@/.*'],
15
+ customGroups: [
16
+ // nuxt
17
+ { elementNamePattern: ['^#app*'], groupName: 'app' },
18
+ { elementNamePattern: ['^#components*'], groupName: 'components' },
19
+ { elementNamePattern: ['^#imports*'], groupName: 'imports' },
20
+ { elementNamePattern: ['^#layers*'], groupName: 'layers' },
21
+ { elementNamePattern: ['^#server*'], groupName: 'server' },
22
+ { elementNamePattern: ['^#shared*'], groupName: 'shared' },
23
+
24
+ // universal
25
+ { elementNamePattern: ['^~/.*/api'], groupName: 'universal-api' },
26
+ {
27
+ elementNamePattern: ['^~/.*/assets'],
28
+ groupName: 'universal-assets',
29
+ },
30
+ {
31
+ elementNamePattern: ['^~/.*/components'],
32
+ groupName: 'universal-components',
33
+ },
34
+ {
35
+ elementNamePattern: ['^~/.*/composables'],
36
+ groupName: 'universal-composables',
37
+ },
38
+ {
39
+ elementNamePattern: ['^~/.*/constants'],
40
+ groupName: 'universal-constants',
41
+ },
42
+ {
43
+ elementNamePattern: ['^~/.*/directives'],
44
+ groupName: 'universal-directives',
45
+ },
46
+ {
47
+ elementNamePattern: ['^~/.*/pages'],
48
+ groupName: 'universal-pages',
49
+ },
50
+ {
51
+ elementNamePattern: ['^~/.*/plugins'],
52
+ groupName: 'universal-plugins',
53
+ },
54
+ {
55
+ elementNamePattern: ['^~/.*/stores'],
56
+ groupName: 'universal-stores',
57
+ },
58
+ {
59
+ elementNamePattern: ['^~/.*/utils'],
60
+ groupName: 'universal-utils',
61
+ },
62
+ ],
63
+ groups: [
64
+ 'type-import',
65
+ ['value-builtin', 'value-external'],
66
+
67
+ // nuxt
68
+ 'app',
69
+ 'components',
70
+ 'imports',
71
+ 'layers',
72
+ 'server',
73
+ 'shared',
74
+
75
+ // universal
76
+ 'universal-api',
77
+ 'universal-assets',
78
+ 'universal-components',
79
+ 'universal-composables',
80
+ 'universal-constants',
81
+ 'universal-directives',
82
+ 'universal-pages',
83
+ 'universal-plugins',
84
+ 'universal-stores',
85
+ 'universal-utils',
86
+
87
+ 'type-internal',
88
+ 'value-internal',
89
+ ['type-parent', 'type-sibling', 'type-index'],
90
+ ['value-parent', 'value-sibling', 'value-index'],
91
+ 'ts-equals-import',
92
+ 'unknown',
93
+ ],
94
+ internalPattern: ['^~/.*', '^~~/.*', '^@/.*', '^@@/.*'],
16
95
  type: 'natural',
17
96
  },
18
97
  ],
@@ -14,7 +14,6 @@ export const typescript = defineConfig([
14
14
  rules: {
15
15
  '@typescript-eslint/naming-convention': [
16
16
  'error',
17
-
18
17
  {
19
18
  format: ['strictCamelCase'],
20
19
  leadingUnderscore: 'allow',
@@ -42,15 +41,6 @@ export const typescript = defineConfig([
42
41
  '@typescript-eslint/no-explicit-any': 'warn',
43
42
  },
44
43
  },
45
- {
46
- files: ['**/*.vue'],
47
- rules: {
48
- '@typescript-eslint/no-empty-object-type': [
49
- 'error',
50
- { allowWithName: 'Props$' },
51
- ],
52
- },
53
- },
54
44
  {
55
45
  files: ['**/*.{fixtures,test,spec}.{js,ts}'],
56
46
  rules: { '@typescript-eslint/no-empty-function': 'off' },
package/plugins/vue.js CHANGED
@@ -18,8 +18,26 @@ export const vue = defineConfig([
18
18
  files: ['**/*.vue'],
19
19
  languageOptions: { parserOptions: { parser: typescript.parser } },
20
20
  rules: {
21
+ '@typescript-eslint/naming-convention': [
22
+ 'error',
23
+ {
24
+ custom: { match: true, regex: '^[A-Z][a-zA-Z0-9]+Props$' },
25
+ format: ['PascalCase'],
26
+ selector: 'interface',
27
+ },
28
+ ],
29
+ '@typescript-eslint/no-empty-object-type': [
30
+ 'error',
31
+ { allowWithName: 'Props$' },
32
+ ],
21
33
  'no-restricted-syntax': [
22
34
  'error',
35
+ {
36
+ message:
37
+ 'Запрещено использовать имя "Props". Используйте именованный формат, например: <ИмяКомпонента>Props.',
38
+ selector:
39
+ "TSInterfaceDeclaration[id.name='Props'], TSTypeAliasDeclaration[id.name='Props']",
40
+ },
23
41
  {
24
42
  message:
25
43
  'При вызове useRoute() переменная должна называться строго "$route" (const $route = useRoute()).',