@alexlit/config-eslint 153.4.0 → 154.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/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## v154.0.0
5
+
6
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.5.0...v154.0.0)
7
+
8
+ ## v153.5.0
9
+
10
+ [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.4.0...v153.5.0)
11
+
12
+ ### 🏡 Chore
13
+
14
+ - **@alexlit/lint-kit:** Bump version ([361cb371](https://github.com/alex-lit/lint-kit/commit/361cb371))
15
+
16
+ ### ❤️ Contributors
17
+
18
+ - Alexey Litovchenko ([@alex-lit](https://github.com/alex-lit))
19
+
4
20
  ## v153.4.0
5
21
 
6
22
  [compare changes](https://github.com/alex-lit/lint-kit/compare/@alexlit/config-eslint@153.3.0...v153.4.0)
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { deMorgan } from './plugins/de-morgan.js';
1
2
  export { javascript } from './plugins/javascript.js';
2
3
  export { jsdoc } from './plugins/jsdoc.js';
3
4
  export { json } from './plugins/json.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexlit/config-eslint",
3
- "version": "153.4.0",
3
+ "version": "154.0.0",
4
4
  "private": false,
5
5
  "description": "Sharable ESLint configuration",
6
6
  "keywords": [
@@ -45,10 +45,11 @@
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-de-morgan": "^2.1.3",
52
53
  "eslint-plugin-jsdoc": "^64.2.1",
53
54
  "eslint-plugin-perfectionist": "^5.10.1",
54
55
  "eslint-plugin-pinia": "^0.4.2",
@@ -0,0 +1,5 @@
1
+ import plugin from 'eslint-plugin-de-morgan';
2
+ import { defineConfig } from 'eslint/config';
3
+
4
+ /** @see [eslint-plugin-de-morgan](https://github.com/azat-io/eslint-plugin-de-morgan) */
5
+ export const deMorgan = defineConfig([plugin.configs.recommended]);
@@ -12,7 +12,86 @@ export const perfectionist = defineConfig([
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()).',
@@ -1,5 +1,6 @@
1
1
  import { defineConfig } from 'eslint/config';
2
2
 
3
+ import { deMorgan } from '../plugins/de-morgan.js';
3
4
  import { javascript } from '../plugins/javascript.js';
4
5
  import { jsdoc } from '../plugins/jsdoc.js';
5
6
  import { json } from '../plugins/json.js';
@@ -19,6 +20,7 @@ export const defaultPreset = defineConfig([
19
20
  ...base, // must be first
20
21
 
21
22
  ...javascript,
23
+ ...deMorgan,
22
24
  ...jsdoc,
23
25
  ...json,
24
26
  ...perfectionist,