@alexlit/config-eslint 154.0.1 → 154.1.1

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
+ ## v154.1.1
5
+
6
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@154.1.0...v154.1.1)
7
+
8
+ ### 🏡 Chore
9
+
10
+ - **@alexlit/lint-kit:** Bump version ([50a19e17](https://github.com/alex-lit/lint-kit/commit/50a19e17))
11
+
12
+ ### ❤️ Contributors
13
+
14
+ - Alexey Litovchenko ([@alex-lit](https://github.com/alex-lit))
15
+
16
+ ## v154.1.0
17
+
18
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@154.0.1...v154.1.0)
19
+
20
+ ### 🏡 Chore
21
+
22
+ - **@alexlit/config-stylelint:** Bump version ([a138a873](https://github.com/alex-lit/lint-kit/commit/a138a873))
23
+ - **@alexlit/lint-kit:** Bump version ([e2db912e](https://github.com/alex-lit/lint-kit/commit/e2db912e))
24
+
25
+ ### ❤️ Contributors
26
+
27
+ - Alexey Litovchenko ([@alex-lit](https://github.com/alex-lit))
28
+
4
29
  ## v154.0.1
5
30
 
6
31
  [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@154.0.0...v154.0.1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "154.0.1",
3
+ "version": "154.1.1",
4
4
  "private": false,
5
5
  "description": "Sharable ESLint configuration",
6
6
  "keywords": [
@@ -20,20 +20,41 @@ export const javascript = defineConfig([
20
20
  'no-restricted-exports': [
21
21
  'error',
22
22
  {
23
- restrictedNamedExports: [
24
- 'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
25
- ],
23
+ restrictedNamedExports: ['then'],
24
+ restrictedNamedExportsPattern: '^_',
26
25
  },
27
26
  ],
28
27
  'no-restricted-imports': [
29
28
  'error',
30
29
  {
31
30
  patterns: [
31
+ // Алиасы
32
+ { group: ['~/', '~~/'], message: 'Используйте "@" вместо "~".' },
33
+ // Расширения
34
+ {
35
+ message: 'Не указывайте расширения .ts или .js в путях импорта.',
36
+ regex: String.raw`\.[jt]sx?$`,
37
+ },
38
+ // Относительные импорты
39
+ { group: ['..', '*/..'], message: 'Используйте абсолютный путь.' },
40
+ {
41
+ message: 'Не используйте индексный импорт.',
42
+ regex: String.raw`^\.$`,
43
+ },
44
+ {
45
+ group: ['**/index'],
46
+ message: 'Не используйте индексный импорт.',
47
+ },
48
+ // Внешние локальные ресурсы
49
+ {
50
+ group: ['@/**/_*', '@@/**/_*', '~/**/_*', '~~/**/_*'],
51
+ message: 'Этот локальный ресурс не преднаназначен для импорта.',
52
+ },
53
+ // Устаревший функционал
32
54
  {
33
- group: ['.', '..', '*/..'],
34
- message: 'Use absolute path instead',
55
+ message: 'Этот функционал устарел.',
56
+ regex: '(_deprecated|_legacy)',
35
57
  },
36
- { group: ['@/', '@@/'], message: 'Use "~" instead of "@"' },
37
58
  ],
38
59
  },
39
60
  ],
@@ -22,43 +22,37 @@ export const perfectionist = defineConfig([
22
22
  { elementNamePattern: ['^#shared*'], groupName: 'shared' },
23
23
 
24
24
  // universal
25
- { elementNamePattern: ['^~/.*/api'], groupName: 'universal-api' },
25
+ { elementNamePattern: ['^@/api'], groupName: 'universal-api' },
26
26
  {
27
- elementNamePattern: ['^~/.*/assets'],
27
+ elementNamePattern: ['^@/assets'],
28
28
  groupName: 'universal-assets',
29
29
  },
30
30
  {
31
- elementNamePattern: ['^~/.*/components'],
31
+ elementNamePattern: ['^@/components'],
32
32
  groupName: 'universal-components',
33
33
  },
34
34
  {
35
- elementNamePattern: ['^~/.*/composables'],
35
+ elementNamePattern: ['^@/composables'],
36
36
  groupName: 'universal-composables',
37
37
  },
38
38
  {
39
- elementNamePattern: ['^~/.*/constants'],
39
+ elementNamePattern: ['^@/constants'],
40
40
  groupName: 'universal-constants',
41
41
  },
42
42
  {
43
- elementNamePattern: ['^~/.*/directives'],
43
+ elementNamePattern: ['^@/directives'],
44
44
  groupName: 'universal-directives',
45
45
  },
46
+ { elementNamePattern: ['^@/pages'], groupName: 'universal-pages' },
46
47
  {
47
- elementNamePattern: ['^~/.*/pages'],
48
- groupName: 'universal-pages',
49
- },
50
- {
51
- elementNamePattern: ['^~/.*/plugins'],
48
+ elementNamePattern: ['^@/plugins'],
52
49
  groupName: 'universal-plugins',
53
50
  },
54
51
  {
55
- elementNamePattern: ['^~/.*/stores'],
52
+ elementNamePattern: ['^@/stores'],
56
53
  groupName: 'universal-stores',
57
54
  },
58
- {
59
- elementNamePattern: ['^~/.*/utils'],
60
- groupName: 'universal-utils',
61
- },
55
+ { elementNamePattern: ['^@/utils'], groupName: 'universal-utils' },
62
56
  ],
63
57
  groups: [
64
58
  'type-import',