@alexlit/config-eslint 161.4.0 → 162.1.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/README.md +156 -106
- package/base.js +5 -3
- package/index.d.ts +112 -0
- package/index.js +79 -23
- package/package.json +19 -16
- package/plugins/de-morgan.js +9 -4
- package/plugins/import-x.js +50 -37
- package/plugins/javascript.js +96 -85
- package/plugins/jsdoc.js +24 -17
- package/plugins/json.js +31 -24
- package/plugins/perfectionist.js +108 -95
- package/plugins/pinia.js +17 -10
- package/plugins/prettier.js +24 -10
- package/plugins/regexp.js +16 -9
- package/plugins/sonar.js +19 -12
- package/plugins/stylistic.js +107 -100
- package/plugins/tailwindcss.js +17 -6
- package/plugins/tanstack-query.js +16 -9
- package/plugins/typescript-type-checked.js +38 -33
- package/plugins/typescript.js +23 -14
- package/plugins/unicorn.js +73 -64
- package/plugins/unocss.js +12 -5
- package/plugins/vitest.js +20 -13
- package/plugins/vue-accessibility.js +22 -13
- package/plugins/vue-i18n.js +38 -31
- package/plugins/vue.js +255 -242
- package/plugins/zod.js +17 -10
- package/rules/typescript.js +1 -1
package/plugins/import-x.js
CHANGED
|
@@ -18,44 +18,57 @@ const EXTENSIONS = [
|
|
|
18
18
|
'.json',
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Правила для импортов и модулей.
|
|
23
|
+
*
|
|
24
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
25
|
+
*
|
|
26
|
+
* @see [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x)
|
|
27
|
+
*/
|
|
28
|
+
export const importX = () =>
|
|
29
|
+
defineConfig([
|
|
30
|
+
{ ...plugin.flatConfigs.recommended, files: FILES, ignores: DATA_FILES },
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
{
|
|
33
|
+
files: FILES,
|
|
34
|
+
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
|
|
35
|
+
plugins: { 'import-x': plugin },
|
|
36
|
+
rules: {
|
|
37
|
+
'import-x/consistent-type-specifier-style': [
|
|
38
|
+
'error',
|
|
39
|
+
'prefer-top-level',
|
|
40
|
+
],
|
|
41
|
+
'import-x/first': 'error',
|
|
42
|
+
'import-x/newline-after-import': 'warn',
|
|
43
|
+
'import-x/no-absolute-path': 'error',
|
|
44
|
+
'import-x/no-cycle': 'error',
|
|
45
|
+
'import-x/no-extraneous-dependencies': 'error',
|
|
46
|
+
'import-x/no-named-as-default': 'off',
|
|
47
|
+
'import-x/no-named-as-default-member': 'off',
|
|
48
|
+
'import-x/no-nodejs-modules': 'off',
|
|
49
|
+
'import-x/no-self-import': 'error',
|
|
50
|
+
'import-x/no-unresolved': 'off',
|
|
51
|
+
'import-x/no-useless-path-segments': [
|
|
52
|
+
'error',
|
|
53
|
+
{ noUselessIndex: true },
|
|
54
|
+
],
|
|
55
|
+
'import-x/unambiguous': 'error',
|
|
56
|
+
},
|
|
57
|
+
settings: {
|
|
58
|
+
'import-x/extensions': EXTENSIONS,
|
|
59
|
+
'import-x/ignore': ['node_modules', String.raw`\.vue$`],
|
|
60
|
+
'import-x/parsers': { '.vue': [vueParser] },
|
|
61
|
+
'import-x/resolver-next': [
|
|
62
|
+
createNodeResolver({ extensions: EXTENSIONS, tsconfig: 'auto' }),
|
|
63
|
+
],
|
|
64
|
+
},
|
|
43
65
|
},
|
|
44
|
-
settings: {
|
|
45
|
-
'import-x/extensions': EXTENSIONS,
|
|
46
|
-
'import-x/ignore': ['node_modules', String.raw`\.vue$`],
|
|
47
|
-
'import-x/parsers': { '.vue': [vueParser] },
|
|
48
|
-
'import-x/resolver-next': [
|
|
49
|
-
createNodeResolver({ extensions: EXTENSIONS, tsconfig: 'auto' }),
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
{
|
|
68
|
+
files: VUE_FILES,
|
|
69
|
+
rules: {
|
|
70
|
+
'import-x/no-useless-path-segments': 'off',
|
|
71
|
+
'import-x/unambiguous': 'off',
|
|
72
|
+
},
|
|
59
73
|
},
|
|
60
|
-
|
|
61
|
-
]);
|
|
74
|
+
]);
|
package/plugins/javascript.js
CHANGED
|
@@ -5,90 +5,101 @@ import { FILES, TEST_FILES } from '../base.js';
|
|
|
5
5
|
import { NO_RESTRICTED_SYNTAX } from '../rules/restricted-syntax.js';
|
|
6
6
|
import { STYLE_RULES } from '../rules/style.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Базовые правила JavaScript.
|
|
10
|
+
*
|
|
11
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
12
|
+
*
|
|
13
|
+
* @see [eslint](https://eslint.org)
|
|
14
|
+
*/
|
|
15
|
+
export const javascript = () =>
|
|
16
|
+
defineConfig([
|
|
17
|
+
{ files: FILES, ...plugin.configs.recommended },
|
|
18
|
+
{
|
|
19
|
+
files: FILES,
|
|
20
|
+
rules: {
|
|
21
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
22
|
+
...STYLE_RULES,
|
|
23
|
+
'default-case-last': 'error',
|
|
24
|
+
'dot-notation': ['error'],
|
|
25
|
+
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
26
|
+
'no-alert': 'error',
|
|
27
|
+
'no-console': 'warn',
|
|
28
|
+
'no-duplicate-imports': [
|
|
29
|
+
'error',
|
|
30
|
+
{ allowSeparateTypeImports: true, includeExports: false },
|
|
31
|
+
],
|
|
32
|
+
'no-else-return': 'error',
|
|
33
|
+
'no-implicit-coercion': 'error',
|
|
34
|
+
'no-param-reassign': ['error', { props: false }],
|
|
35
|
+
'no-restricted-exports': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
restrictedNamedExports: ['then'],
|
|
39
|
+
restrictedNamedExportsPattern: '^_',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'no-restricted-globals': [
|
|
43
|
+
'error',
|
|
44
|
+
// `event`, `top` and `parent` are global browser properties.
|
|
45
|
+
// Reach for `window.event` / `window.top` / `window.parent` instead.
|
|
46
|
+
{ message: 'Use `window.event` instead.', name: 'event' },
|
|
47
|
+
{ message: 'Use `window.parent` instead.', name: 'parent' },
|
|
48
|
+
{ message: 'Use `window.top` instead.', name: 'top' },
|
|
49
|
+
],
|
|
50
|
+
'no-restricted-imports': [
|
|
51
|
+
'error',
|
|
52
|
+
{
|
|
53
|
+
patterns: [
|
|
54
|
+
// Алиасы
|
|
55
|
+
{ group: ['~/', '~~/'], message: 'Используйте "@" вместо "~".' },
|
|
56
|
+
// Расширения
|
|
57
|
+
{
|
|
58
|
+
message:
|
|
59
|
+
'Не указывайте расширения .ts или .js в путях импорта.',
|
|
60
|
+
regex: String.raw`\.[jt]sx?$`,
|
|
61
|
+
},
|
|
62
|
+
// Относительные импорты
|
|
63
|
+
{
|
|
64
|
+
group: ['..', '*/..'],
|
|
65
|
+
message: 'Используйте абсолютный путь.',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
message: 'Не используйте индексный импорт.',
|
|
69
|
+
regex: String.raw`^\.$`,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
group: ['**/index'],
|
|
73
|
+
message: 'Не используйте индексный импорт.',
|
|
74
|
+
},
|
|
75
|
+
// Внешние локальные ресурсы
|
|
76
|
+
{
|
|
77
|
+
group: ['@/**/_*', '@@/**/_*', '~/**/_*', '~~/**/_*'],
|
|
78
|
+
message: 'Этот локальный ресурс не преднаназначен для импорта.',
|
|
79
|
+
},
|
|
80
|
+
// Устаревший функционал
|
|
81
|
+
{
|
|
82
|
+
message: 'Этот функционал устарел.',
|
|
83
|
+
regex: '(_deprecated|_legacy)',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
'no-restricted-syntax': ['error', ...NO_RESTRICTED_SYNTAX],
|
|
89
|
+
'no-useless-rename': 'error',
|
|
90
|
+
'prefer-arrow-callback': [
|
|
91
|
+
'error',
|
|
92
|
+
{ allowNamedFunctions: false, allowUnboundThis: false },
|
|
93
|
+
],
|
|
94
|
+
'prefer-const': 'warn',
|
|
95
|
+
'prefer-template': 'warn',
|
|
96
|
+
'require-await': 'error',
|
|
97
|
+
},
|
|
86
98
|
},
|
|
87
|
-
},
|
|
88
99
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
]);
|
|
100
|
+
{
|
|
101
|
+
// Tests are allowed to log and to alert
|
|
102
|
+
files: TEST_FILES,
|
|
103
|
+
rules: { 'no-alert': 'off', 'no-console': 'off' },
|
|
104
|
+
},
|
|
105
|
+
]);
|
package/plugins/jsdoc.js
CHANGED
|
@@ -3,21 +3,28 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила для JSDoc-комментариев.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc)
|
|
12
|
+
*/
|
|
13
|
+
export const jsdoc = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{ files: FILES, ...plugin.configs['flat/recommended'] },
|
|
16
|
+
{
|
|
17
|
+
files: FILES,
|
|
18
|
+
rules: {
|
|
19
|
+
'jsdoc/lines-before-block': 'off',
|
|
20
|
+
'jsdoc/no-undefined-types': 'off',
|
|
21
|
+
'jsdoc/require-jsdoc': 'off',
|
|
22
|
+
'jsdoc/require-param-description': 'off',
|
|
23
|
+
'jsdoc/require-param-type': 'off',
|
|
24
|
+
'jsdoc/require-returns': 'off',
|
|
25
|
+
'jsdoc/require-returns-description': 'off',
|
|
26
|
+
'jsdoc/require-returns-type': 'off',
|
|
27
|
+
'jsdoc/tag-lines': 'off',
|
|
28
|
+
},
|
|
21
29
|
},
|
|
22
|
-
|
|
23
|
-
]);
|
|
30
|
+
]);
|
package/plugins/json.js
CHANGED
|
@@ -4,30 +4,37 @@ import * as yamlParser from 'yaml-eslint-parser';
|
|
|
4
4
|
|
|
5
5
|
import { YAML_FILES } from '../base.js';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Правила для JSON, JSONC, JSON5 и YAML-файлов.
|
|
9
|
+
*
|
|
10
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
11
|
+
*
|
|
12
|
+
* @see [ESLint/JSON](https://github.com/eslint/json)
|
|
13
|
+
*/
|
|
14
|
+
export const json = () =>
|
|
15
|
+
defineConfig([
|
|
16
|
+
{
|
|
17
|
+
extends: ['json/recommended'],
|
|
18
|
+
files: ['**/*.json'],
|
|
19
|
+
ignores: ['**/package-lock.json'],
|
|
20
|
+
language: 'json/json',
|
|
21
|
+
plugins: { json: plugin },
|
|
22
|
+
},
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
{
|
|
25
|
+
extends: ['json/recommended'],
|
|
26
|
+
files: ['**/*.jsonc'],
|
|
27
|
+
language: 'json/jsonc',
|
|
28
|
+
languageOptions: { allowTrailingCommas: true },
|
|
29
|
+
plugins: { json: plugin },
|
|
30
|
+
},
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
{
|
|
33
|
+
extends: ['json/recommended'],
|
|
34
|
+
files: ['**/*.json5'],
|
|
35
|
+
language: 'json/json5',
|
|
36
|
+
plugins: { json: plugin },
|
|
37
|
+
},
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
]);
|
|
39
|
+
{ files: YAML_FILES, languageOptions: { parser: yamlParser } },
|
|
40
|
+
]);
|
package/plugins/perfectionist.js
CHANGED
|
@@ -3,107 +3,120 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила сортировки импортов, объектов, интерфейсов и типов.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-perfectionist](https://perfectionist.dev)
|
|
12
|
+
*/
|
|
13
|
+
export const perfectionist = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{ ...plugin.configs['recommended-natural'], files: FILES },
|
|
16
|
+
{
|
|
17
|
+
files: FILES,
|
|
18
|
+
rules: {
|
|
19
|
+
'perfectionist/sort-imports': [
|
|
20
|
+
'warn',
|
|
21
|
+
{
|
|
22
|
+
customGroups: [
|
|
23
|
+
// hash (nuxt)
|
|
24
|
+
{ elementNamePattern: ['^#'], groupName: 'hash' },
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
// @@/
|
|
27
|
+
{ elementNamePattern: ['^@@/'], groupName: 'double-at' },
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
29
|
+
// universal
|
|
30
|
+
{ elementNamePattern: ['^@/api'], groupName: 'universal-api' },
|
|
31
|
+
{
|
|
32
|
+
elementNamePattern: ['^@/assets'],
|
|
33
|
+
groupName: 'universal-assets',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
elementNamePattern: ['^@/components'],
|
|
37
|
+
groupName: 'universal-components',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
elementNamePattern: ['^@/composables'],
|
|
41
|
+
groupName: 'universal-composables',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
elementNamePattern: ['^@/constants'],
|
|
45
|
+
groupName: 'universal-constants',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
elementNamePattern: ['^@/directives'],
|
|
49
|
+
groupName: 'universal-directives',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
elementNamePattern: ['^@/layouts'],
|
|
53
|
+
groupName: 'universal-layouts',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
elementNamePattern: ['^@/pages'],
|
|
57
|
+
groupName: 'universal-pages',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
elementNamePattern: ['^@/plugins'],
|
|
61
|
+
groupName: 'universal-plugins',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
elementNamePattern: ['^@/stores'],
|
|
65
|
+
groupName: 'universal-stores',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
elementNamePattern: ['^@/utils'],
|
|
69
|
+
groupName: 'universal-utils',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
groups: [
|
|
73
|
+
'type-import',
|
|
74
|
+
['value-builtin', 'value-external'],
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
// hash (nuxt)
|
|
77
|
+
'hash',
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
// @@/
|
|
80
|
+
'double-at',
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
// universal
|
|
83
|
+
'universal-api',
|
|
84
|
+
'universal-assets',
|
|
85
|
+
'universal-components',
|
|
86
|
+
'universal-composables',
|
|
87
|
+
'universal-constants',
|
|
88
|
+
'universal-directives',
|
|
89
|
+
'universal-layouts',
|
|
90
|
+
'universal-pages',
|
|
91
|
+
'universal-plugins',
|
|
92
|
+
'universal-stores',
|
|
93
|
+
'universal-utils',
|
|
81
94
|
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
'type-internal',
|
|
96
|
+
'value-internal',
|
|
84
97
|
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
['type-parent', 'type-sibling', 'type-index'],
|
|
99
|
+
['value-parent', 'value-sibling', 'value-index'],
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
'ts-equals-import',
|
|
102
|
+
'unknown',
|
|
103
|
+
],
|
|
104
|
+
internalPattern: ['^@@/.*', '^@/.*'],
|
|
105
|
+
type: 'natural',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
'perfectionist/sort-interfaces': [
|
|
109
|
+
'warn',
|
|
110
|
+
{ newlinesBetween: 0, partitionByComment: false, type: 'natural' },
|
|
111
|
+
],
|
|
112
|
+
'perfectionist/sort-object-types': [
|
|
113
|
+
'warn',
|
|
114
|
+
{ newlinesBetween: 0, partitionByComment: false, type: 'natural' },
|
|
115
|
+
],
|
|
116
|
+
'perfectionist/sort-objects': [
|
|
117
|
+
'warn',
|
|
118
|
+
{ newlinesBetween: 0, partitionByComment: false, type: 'natural' },
|
|
119
|
+
],
|
|
120
|
+
},
|
|
107
121
|
},
|
|
108
|
-
|
|
109
|
-
]);
|
|
122
|
+
]);
|
package/plugins/pinia.js
CHANGED
|
@@ -3,14 +3,21 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила для Pinia-хранилищ.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-pinia](https://github.com/lisilinhart/eslint-plugin-pinia)
|
|
12
|
+
*/
|
|
13
|
+
export const pinia = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{
|
|
16
|
+
...plugin.configs['recommended-flat'],
|
|
17
|
+
files: FILES,
|
|
18
|
+
rules: {
|
|
19
|
+
...plugin.configs['recommended-flat'].rules,
|
|
20
|
+
'pinia/prefer-single-store-per-file': 'error',
|
|
21
|
+
},
|
|
14
22
|
},
|
|
15
|
-
|
|
16
|
-
]);
|
|
23
|
+
]);
|