@alexlit/lint-kit 214.3.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.
- package/README.md +27 -22
- package/eslint.config.js +23 -56
- package/lint-staged.config.js +2 -2
- package/linthtml.config.js +2 -2
- package/package.json +3 -2
- package/packages/config-eslint/README.md +156 -106
- package/packages/config-eslint/base.js +5 -3
- package/packages/config-eslint/index.d.ts +112 -0
- package/packages/config-eslint/index.js +79 -23
- package/packages/config-eslint/package.json +21 -18
- package/packages/config-eslint/plugins/de-morgan.js +9 -4
- package/packages/config-eslint/plugins/import-x.js +50 -37
- package/packages/config-eslint/plugins/javascript.js +96 -85
- package/packages/config-eslint/plugins/jsdoc.js +24 -17
- package/packages/config-eslint/plugins/json.js +31 -24
- package/packages/config-eslint/plugins/perfectionist.js +108 -95
- package/packages/config-eslint/plugins/pinia.js +17 -10
- package/packages/config-eslint/plugins/prettier.js +24 -10
- package/packages/config-eslint/plugins/regexp.js +16 -9
- package/packages/config-eslint/plugins/sonar.js +19 -12
- package/packages/config-eslint/plugins/stylistic.js +107 -100
- package/packages/config-eslint/plugins/tailwindcss.js +17 -6
- package/packages/config-eslint/plugins/tanstack-query.js +16 -9
- package/packages/config-eslint/plugins/typescript-type-checked.js +38 -33
- package/packages/config-eslint/plugins/typescript.js +23 -14
- package/packages/config-eslint/plugins/unicorn.js +73 -64
- package/packages/config-eslint/plugins/unocss.js +12 -5
- package/packages/config-eslint/plugins/vitest.js +20 -13
- package/packages/config-eslint/plugins/vue-accessibility.js +22 -13
- package/packages/config-eslint/plugins/vue-i18n.js +38 -31
- package/packages/config-eslint/plugins/vue.js +255 -242
- package/packages/config-eslint/plugins/zod.js +17 -10
- package/packages/config-eslint/rules/typescript.js +1 -1
- package/packages/config-hooks/README.md +119 -37
- package/packages/config-hooks/index.d.ts +19 -0
- package/packages/config-hooks/lint-staged.js +8 -6
- package/packages/config-hooks/package.json +3 -1
- package/packages/config-htmllint/README.md +50 -22
- package/packages/config-htmllint/index.d.ts +13 -0
- package/packages/config-htmllint/index.js +15 -7
- package/packages/config-htmllint/package.json +4 -2
- package/packages/config-markdownlint/README.md +40 -5
- package/packages/config-markdownlint/index.json +0 -2
- package/packages/config-markdownlint/package.json +1 -1
- package/packages/config-npmlint/README.md +48 -5
- package/packages/config-npmlint/package.json +3 -3
- package/packages/config-prettier/README.md +106 -23
- package/packages/config-prettier/index.d.ts +92 -0
- package/packages/config-prettier/index.js +60 -74
- package/packages/config-prettier/package.json +5 -4
- package/packages/config-prettier/plugins/jsdoc.js +12 -3
- package/packages/config-prettier/plugins/mdc.js +12 -3
- package/packages/config-prettier/plugins/packagejson.js +12 -3
- package/packages/config-prettier/plugins/php.js +12 -3
- package/packages/config-prettier/plugins/pug.js +12 -3
- package/packages/config-prettier/plugins/ruby.js +10 -10
- package/packages/config-prettier/plugins/sh.js +12 -3
- package/packages/config-prettier/plugins/solidity.js +12 -3
- package/packages/config-prettier/plugins/sort-json.js +12 -3
- package/packages/config-prettier/plugins/sql.js +12 -3
- package/packages/config-prettier/plugins/tailwindcss.js +12 -3
- package/packages/config-prettier/plugins/xml.js +12 -3
- package/packages/config-stylelint/README.md +131 -44
- package/packages/config-stylelint/index.d.ts +52 -0
- package/packages/config-stylelint/index.js +169 -165
- package/packages/config-stylelint/package.json +3 -1
- package/packages/config-stylelint/plugins/a11y.js +24 -11
- package/packages/config-stylelint/plugins/bem.js +10 -3
- package/packages/config-stylelint/plugins/color-format.js +14 -4
- package/packages/config-stylelint/plugins/declaration-block-no-ignored-properties.js +15 -4
- package/packages/config-stylelint/plugins/gamut.js +12 -4
- package/packages/config-stylelint/plugins/high-performance-animation.js +12 -3
- package/packages/config-stylelint/plugins/logical-css.js +10 -3
- package/packages/config-stylelint/plugins/media-use-custom-media.js +12 -4
- package/packages/config-stylelint/plugins/no-indistinguishable-colors.js +15 -4
- package/packages/config-stylelint/plugins/no-nested-media.js +12 -4
- package/packages/config-stylelint/plugins/no-unresolved-module.js +12 -3
- package/packages/config-stylelint/plugins/no-unsupported-browser-features.js +12 -3
- package/packages/config-stylelint/plugins/order.js +13 -3
- package/packages/config-stylelint/plugins/prettier.js +12 -4
- package/packages/config-stylelint/plugins/scss.js +13 -3
- package/packages/config-stylelint/plugins/selector-no-empty.js +12 -4
- package/packages/config-stylelint/plugins/use-nesting.js +15 -4
- package/packages/config-stylelint/plugins/vue.js +11 -2
- package/prettier.config.js +15 -7
- package/scripts/semver.sh +3 -3
- package/stylelint.config.js +25 -11
- package/packages/config-eslint/_legacy/LICENSE +0 -20
- package/packages/config-eslint/_legacy/README.md +0 -48
- package/packages/config-eslint/_legacy/constants/allow-boolean-property-list.js +0 -38
- package/packages/config-eslint/_legacy/constants/boolean-prefixes.js +0 -11
- package/packages/config-eslint/_legacy/constants/english-verbs.js +0 -3368
- package/packages/config-eslint/_legacy/dictionaries/index.js +0 -467
- package/packages/config-eslint/_legacy/dictionaries/programming/bash.js +0 -25
- package/packages/config-eslint/_legacy/dictionaries/programming/django.js +0 -2345
- package/packages/config-eslint/_legacy/dictionaries/programming/elixir.js +0 -64
- package/packages/config-eslint/_legacy/dictionaries/programming/go.js +0 -7748
- package/packages/config-eslint/_legacy/dictionaries/programming/java.js +0 -33527
- package/packages/config-eslint/_legacy/dictionaries/programming/latex.js +0 -675
- package/packages/config-eslint/_legacy/dictionaries/programming/lua.js +0 -394
- package/packages/config-eslint/_legacy/dictionaries/programming/php.js +0 -9788
- package/packages/config-eslint/_legacy/dictionaries/programming/python.js +0 -367
- package/packages/config-eslint/_legacy/dictionaries/programming/ruby.js +0 -357
- package/packages/config-eslint/_legacy/dictionaries/programming/rust.js +0 -115
- package/packages/config-eslint/_legacy/dictionaries/programming/scala.js +0 -2755
- package/packages/config-eslint/_legacy/dictionaries/specialized/html-symbol-entities.js +0 -1118
- package/packages/config-eslint/_legacy/dictionaries/specialized/lorem-ipsum.js +0 -359
- package/packages/config-eslint/_legacy/index.js +0 -12
- package/packages/config-eslint/_legacy/legacy.js +0 -3
- package/packages/config-eslint/_legacy/package.json +0 -97
- package/packages/config-eslint/_legacy/plugins/array-func.js +0 -20
- package/packages/config-eslint/_legacy/plugins/compat.js +0 -7
- package/packages/config-eslint/_legacy/plugins/decorator-position.js +0 -15
- package/packages/config-eslint/_legacy/plugins/eslint-comments.js +0 -9
- package/packages/config-eslint/_legacy/plugins/etc.js +0 -13
- package/packages/config-eslint/_legacy/plugins/ext.js +0 -12
- package/packages/config-eslint/_legacy/plugins/filenames.js +0 -38
- package/packages/config-eslint/_legacy/plugins/import.js +0 -133
- package/packages/config-eslint/_legacy/plugins/jsdoc.js +0 -32
- package/packages/config-eslint/_legacy/plugins/jsx-a11y.js +0 -5
- package/packages/config-eslint/_legacy/plugins/lit-a11y.js +0 -5
- package/packages/config-eslint/_legacy/plugins/lit.js +0 -9
- package/packages/config-eslint/_legacy/plugins/more.js +0 -17
- package/packages/config-eslint/_legacy/plugins/no-await-in-promise.js +0 -5
- package/packages/config-eslint/_legacy/plugins/no-constructor-bind.js +0 -8
- package/packages/config-eslint/_legacy/plugins/no-explicit-type-exports.js +0 -7
- package/packages/config-eslint/_legacy/plugins/no-loops.js +0 -7
- package/packages/config-eslint/_legacy/plugins/no-secrets.js +0 -12
- package/packages/config-eslint/_legacy/plugins/no-use-extend-native.js +0 -5
- package/packages/config-eslint/_legacy/plugins/node.js +0 -5
- package/packages/config-eslint/_legacy/plugins/prettier.js +0 -24
- package/packages/config-eslint/_legacy/plugins/promise.js +0 -10
- package/packages/config-eslint/_legacy/plugins/regexp.js +0 -7
- package/packages/config-eslint/_legacy/plugins/security.js +0 -10
- package/packages/config-eslint/_legacy/plugins/simple-import-sort.js +0 -7
- package/packages/config-eslint/_legacy/plugins/sonar.js +0 -5
- package/packages/config-eslint/_legacy/plugins/sort-class-members.js +0 -298
- package/packages/config-eslint/_legacy/plugins/sort-destructure-keys.js +0 -10
- package/packages/config-eslint/_legacy/plugins/sort-keys-fix.js +0 -7
- package/packages/config-eslint/_legacy/plugins/spellcheck.js +0 -9
- package/packages/config-eslint/_legacy/plugins/sql.js +0 -26
- package/packages/config-eslint/_legacy/plugins/tanstack-query.js +0 -4
- package/packages/config-eslint/_legacy/plugins/testing-library.js +0 -9
- package/packages/config-eslint/_legacy/plugins/typescript-sort-keys.js +0 -5
- package/packages/config-eslint/_legacy/plugins/typescript.js +0 -157
- package/packages/config-eslint/_legacy/plugins/unicorn.js +0 -70
- package/packages/config-eslint/_legacy/plugins/unused-imports.js +0 -17
- package/packages/config-eslint/_legacy/plugins/vitest.js +0 -16
- package/packages/config-eslint/_legacy/plugins/vue-i18n.js +0 -34
- package/packages/config-eslint/_legacy/plugins/vue.js +0 -291
- package/packages/config-eslint/_legacy/plugins/vuejs-accessibility.js +0 -20
- package/packages/config-eslint/_legacy/plugins/wc.js +0 -5
- package/packages/config-eslint/_legacy/plugins/write-good-comments.js +0 -7
- package/packages/config-eslint/_legacy/utils/create-config.js +0 -377
- package/packages/config-eslint/_legacy/utils/extend-spell-checker.js +0 -23
|
@@ -5,46 +5,51 @@ import { DATA_FILES, FILES, TEST_FILES, TS_FILES } from '../base.js';
|
|
|
5
5
|
import { TS_RULES } from '../rules/typescript.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Type-aware TypeScript
|
|
8
|
+
* Type-aware правила TypeScript.
|
|
9
9
|
*
|
|
10
10
|
* Opt-in: requires a `tsconfig.json` in the project and needs type information,
|
|
11
11
|
* which makes linting slower. Use it instead of `typescript`, not alongside
|
|
12
12
|
* it.
|
|
13
13
|
*
|
|
14
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
15
|
+
*
|
|
14
16
|
* @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
|
|
15
17
|
*/
|
|
16
|
-
export const typescriptTypeChecked =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export const typescriptTypeChecked = () =>
|
|
19
|
+
defineConfig([
|
|
20
|
+
// The parser is needed for every JS/TS/Vue file, not only for TypeScript ones,
|
|
21
|
+
// otherwise `.js` files fall back to the default parser and modern syntax
|
|
22
|
+
// (`import.meta`, top-level await) breaks.
|
|
23
|
+
{ ...plugin.configs.base, files: FILES },
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
// Non type-aware rules - the same scope as the regular `typescript` plugin,
|
|
26
|
+
// so `.js`/`.vue` files keep the TypeScript versions of the rules.
|
|
27
|
+
// `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
|
|
28
|
+
// so they would also land on data files that are not JavaScript at all.
|
|
29
|
+
...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
|
|
30
|
+
(config) => ({
|
|
31
|
+
...config,
|
|
32
|
+
ignores: [...(config.ignores ?? []), ...DATA_FILES],
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
// Type-aware rules only make sense where the type information is available.
|
|
37
|
+
...plugin.configs.strictTypeChecked.map((config) => ({
|
|
38
|
+
...config,
|
|
39
|
+
files: TS_FILES,
|
|
40
|
+
})),
|
|
41
|
+
...plugin.configs.stylisticTypeChecked.map((config) => ({
|
|
42
|
+
...config,
|
|
43
|
+
files: TS_FILES,
|
|
44
|
+
})),
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]);
|
|
46
|
+
{
|
|
47
|
+
files: TS_FILES,
|
|
48
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
49
|
+
rules: TS_RULES,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
files: TEST_FILES,
|
|
53
|
+
rules: { '@typescript-eslint/no-empty-function': 'off' },
|
|
54
|
+
},
|
|
55
|
+
]);
|
|
@@ -4,18 +4,27 @@ import plugin from 'typescript-eslint';
|
|
|
4
4
|
import { DATA_FILES, FILES, TEST_FILES } from '../base.js';
|
|
5
5
|
import { TS_RULES } from '../rules/typescript.js';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Правила TypeScript без анализа типов.
|
|
9
|
+
*
|
|
10
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
11
|
+
*
|
|
12
|
+
* @see [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint)
|
|
13
|
+
*/
|
|
14
|
+
export const typescript = () =>
|
|
15
|
+
defineConfig([
|
|
16
|
+
// `plugin.configs.strict`/`stylistic` contain blocks without a `files` key,
|
|
17
|
+
// so they would also land on data files that are not JavaScript at all.
|
|
18
|
+
...[...plugin.configs.strict, ...plugin.configs.stylistic].map(
|
|
19
|
+
(config) => ({
|
|
20
|
+
...config,
|
|
21
|
+
ignores: [...(config.ignores ?? []), ...DATA_FILES],
|
|
22
|
+
}),
|
|
23
|
+
),
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]);
|
|
25
|
+
{ files: FILES, rules: TS_RULES },
|
|
26
|
+
{
|
|
27
|
+
files: TEST_FILES,
|
|
28
|
+
rules: { '@typescript-eslint/no-empty-function': 'off' },
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
@@ -3,70 +3,79 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { DTS_FILES, FILES, VUE_FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила unicorn.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
12
|
+
*/
|
|
13
|
+
export const unicorn = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{ ...plugin.configs.recommended, files: FILES },
|
|
16
|
+
{
|
|
17
|
+
files: FILES,
|
|
18
|
+
rules: {
|
|
19
|
+
'unicorn/comment-content': ['warn'],
|
|
20
|
+
'unicorn/consistent-function-scoping': [
|
|
21
|
+
'error',
|
|
22
|
+
{ checkArrowFunctions: false },
|
|
23
|
+
],
|
|
24
|
+
'unicorn/consistent-function-style': [
|
|
25
|
+
'error',
|
|
26
|
+
{ default: 'arrow-function' },
|
|
27
|
+
],
|
|
28
|
+
// Explicit: the default happens to be kebab case, but the intent is
|
|
29
|
+
// worth pinning down. Applies to `.vue` components too, which is why
|
|
30
|
+
// `vue/match-component-file-name` is kept in sync with it in `vue.js`.
|
|
31
|
+
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
|
|
32
|
+
'unicorn/iteration-fallback-style': ['error', 'guard'],
|
|
33
|
+
'unicorn/name-replacements': 'off',
|
|
34
|
+
'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
|
|
35
|
+
'unicorn/no-asterisk-prefix-in-documentation-comments': 'off',
|
|
36
|
+
'unicorn/no-empty-file': 'off',
|
|
37
|
+
'unicorn/no-for-each': 'off',
|
|
38
|
+
'unicorn/no-this-outside-of-class': 'off', // used in setters/getters
|
|
39
|
+
'unicorn/no-top-level-side-effects': 'off', // Vue.js specific
|
|
40
|
+
'unicorn/no-unused-properties': 'off', // don't respect local keys
|
|
41
|
+
'unicorn/prefer-dom-node-html-methods': 'off', // Safari not supports setHTML()
|
|
42
|
+
'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
|
|
43
|
+
'unicorn/prefer-https': 'off', // SVG need HTTP
|
|
44
|
+
'unicorn/prefer-import-meta-properties': 'warn',
|
|
45
|
+
'unicorn/prefer-iterator-concat': 'off', // ES2026 only
|
|
46
|
+
'unicorn/prefer-json-import': 'warn',
|
|
47
|
+
'unicorn/prefer-module': 'warn',
|
|
48
|
+
'unicorn/prefer-node-protocol': 'warn',
|
|
49
|
+
'unicorn/prefer-temporal': 'off', // ES2026 only
|
|
50
|
+
'unicorn/prefer-type-literal-last': 'off', // perfectionist/sort-intersection-types
|
|
51
|
+
'unicorn/prefer-uint8array-hex': 'warn',
|
|
52
|
+
'unicorn/relative-url-style': ['error', 'always'],
|
|
53
|
+
'unicorn/single-line-block-comment-style': 'off',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{ files: ['**/.*'], rules: { 'unicorn/no-null': 'off' } },
|
|
57
|
+
{ files: DTS_FILES, rules: { 'unicorn/prefer-export-from': 'off' } },
|
|
58
|
+
{
|
|
59
|
+
// `null` is part of the type contract in Vue.js SFC:
|
|
60
|
+
// `ref<Type | null>(null)` is the idiomatic way to declare an initially
|
|
61
|
+
// empty reactive value. Everywhere else `null` remains an error.
|
|
62
|
+
files: VUE_FILES,
|
|
63
|
+
rules: { 'unicorn/no-null': 'off' },
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
files: [
|
|
67
|
+
'**/*.{api,endpoints,fixtures,schemas,service,spec,test}.{js,ts}',
|
|
20
68
|
],
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'unicorn/no-asterisk-prefix-in-documentation-comments': 'off',
|
|
29
|
-
'unicorn/no-empty-file': 'off',
|
|
30
|
-
'unicorn/no-for-each': 'off',
|
|
31
|
-
'unicorn/no-this-outside-of-class': 'off', // used in setters/getters
|
|
32
|
-
'unicorn/no-top-level-side-effects': 'off', // Vue.js specific
|
|
33
|
-
'unicorn/no-unused-properties': 'off', // don't respect local keys
|
|
34
|
-
'unicorn/prefer-dom-node-html-methods': 'off', // Safari not supports setHTML()
|
|
35
|
-
'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
|
|
36
|
-
'unicorn/prefer-https': 'off', // SVG need HTTP
|
|
37
|
-
'unicorn/prefer-import-meta-properties': 'warn',
|
|
38
|
-
'unicorn/prefer-iterator-concat': 'off', // ES2026 only
|
|
39
|
-
'unicorn/prefer-json-import': 'warn',
|
|
40
|
-
'unicorn/prefer-module': 'warn',
|
|
41
|
-
'unicorn/prefer-node-protocol': 'warn',
|
|
42
|
-
'unicorn/prefer-temporal': 'off', // ES2026 only
|
|
43
|
-
'unicorn/prefer-type-literal-last': 'off', // perfectionist/sort-intersection-types
|
|
44
|
-
'unicorn/prefer-uint8array-hex': 'warn',
|
|
45
|
-
'unicorn/relative-url-style': ['error', 'always'],
|
|
46
|
-
'unicorn/single-line-block-comment-style': 'off',
|
|
69
|
+
rules: {
|
|
70
|
+
'unicorn/max-nested-calls': 'off',
|
|
71
|
+
'unicorn/no-keyword-prefix': 'off',
|
|
72
|
+
'unicorn/no-null': 'off',
|
|
73
|
+
'unicorn/no-object-as-default-parameter': 'off',
|
|
74
|
+
'unicorn/no-useless-undefined': 'off',
|
|
75
|
+
},
|
|
47
76
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
// `null` is part of the type contract in Vue.js SFC:
|
|
53
|
-
// `ref<Type | null>(null)` is the idiomatic way to declare an initially
|
|
54
|
-
// empty reactive value. Everywhere else `null` remains an error.
|
|
55
|
-
files: VUE_FILES,
|
|
56
|
-
rules: { 'unicorn/no-null': 'off' },
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
files: ['**/*.{api,endpoints,fixtures,schemas,service,spec,test}.{js,ts}'],
|
|
60
|
-
rules: {
|
|
61
|
-
'unicorn/max-nested-calls': 'off',
|
|
62
|
-
'unicorn/no-keyword-prefix': 'off',
|
|
63
|
-
'unicorn/no-null': 'off',
|
|
64
|
-
'unicorn/no-object-as-default-parameter': 'off',
|
|
65
|
-
'unicorn/no-useless-undefined': 'off',
|
|
77
|
+
{
|
|
78
|
+
files: ['**/temp/**/*.vue'],
|
|
79
|
+
rules: { 'unicorn/name-replacements': 'off' },
|
|
66
80
|
},
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
files: ['**/temp/**/*.vue'],
|
|
70
|
-
rules: { 'unicorn/name-replacements': 'off' },
|
|
71
|
-
},
|
|
72
|
-
]);
|
|
81
|
+
]);
|
|
@@ -3,8 +3,15 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила для UnoCSS.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [@unocss/eslint-config](https://unocss.dev/integrations/eslint)
|
|
12
|
+
*/
|
|
13
|
+
export const unocss = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{ files: FILES, ...plugin },
|
|
16
|
+
{ files: FILES, rules: { 'unocss/order-attributify': 'off' } },
|
|
17
|
+
]);
|
|
@@ -3,18 +3,25 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
|
|
4
4
|
import { TEST_FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила для тестов Vitest.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest)
|
|
12
|
+
*/
|
|
13
|
+
export const vitest = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
{
|
|
16
|
+
files: TEST_FILES,
|
|
17
|
+
plugins: { vitest: plugin },
|
|
18
|
+
rules: {
|
|
19
|
+
...plugin.configs.recommended.rules,
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
'vitest/no-conditional-in-test': 'off',
|
|
22
|
+
'vitest/no-conditional-tests': 'off',
|
|
23
|
+
'vitest/no-hooks': 'off',
|
|
24
|
+
'vitest/require-to-throw-message': 'off',
|
|
25
|
+
},
|
|
18
26
|
},
|
|
19
|
-
|
|
20
|
-
]);
|
|
27
|
+
]);
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import plugin from 'eslint-plugin-vuejs-accessibility';
|
|
2
2
|
import { defineConfig } from 'eslint/config';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
export const vueAccessibility = defineConfig([
|
|
6
|
-
...plugin.configs['flat/recommended'],
|
|
4
|
+
import { VUE_FILES } from '../base.js';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила доступности Vue.js-компонентов.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-vuejs-accessibility](https://vue-a11y.github.io/eslint-plugin-vuejs-accessibility/)
|
|
12
|
+
*/
|
|
13
|
+
export const vueAccessibility = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
...plugin.configs['flat/recommended'],
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
files: VUE_FILES,
|
|
19
|
+
rules: {
|
|
20
|
+
'vuejs-accessibility/label-has-for': [
|
|
21
|
+
'warn',
|
|
22
|
+
{ allowChildren: true, required: { some: ['nesting', 'id'] } },
|
|
23
|
+
],
|
|
24
|
+
'vuejs-accessibility/no-autofocus': ['warn', { ignoreNonDOM: true }],
|
|
25
|
+
},
|
|
16
26
|
},
|
|
17
|
-
|
|
18
|
-
]);
|
|
27
|
+
]);
|
|
@@ -1,39 +1,46 @@
|
|
|
1
1
|
import plugin from '@intlify/eslint-plugin-vue-i18n';
|
|
2
2
|
import { defineConfig } from 'eslint/config';
|
|
3
3
|
|
|
4
|
-
import { DATA_FILES } from '../base.js';
|
|
4
|
+
import { DATA_FILES, VUE_FILES } from '../base.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Правила для Vue.js I18n.
|
|
8
|
+
*
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*
|
|
11
|
+
* @see [eslint-plugin-vue-i18n](https://eslint-plugin-vue-i18n.intlify.dev/)
|
|
12
|
+
*/
|
|
13
|
+
export const vueI18n = () =>
|
|
14
|
+
defineConfig([
|
|
15
|
+
...plugin.configs['flat/recommended'].map((config) => ({
|
|
16
|
+
...config,
|
|
17
|
+
ignores: [...(config.ignores ?? []), ...DATA_FILES],
|
|
18
|
+
})),
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
{
|
|
21
|
+
files: VUE_FILES,
|
|
22
|
+
rules: {
|
|
23
|
+
'@intlify/vue-i18n/key-format-style': [
|
|
24
|
+
'error',
|
|
25
|
+
'snake_case',
|
|
26
|
+
{ allowArray: false },
|
|
27
|
+
],
|
|
28
|
+
'@intlify/vue-i18n/no-duplicate-keys-in-locale': [
|
|
29
|
+
'error',
|
|
30
|
+
{ ignoreI18nBlock: false },
|
|
31
|
+
],
|
|
32
|
+
'@intlify/vue-i18n/no-dynamic-keys': 'warn',
|
|
33
|
+
'@intlify/vue-i18n/no-raw-text': 'off',
|
|
34
|
+
'@intlify/vue-i18n/no-unused-keys': 'warn',
|
|
35
|
+
'@intlify/vue-i18n/prefer-sfc-lang-attr': 'error',
|
|
36
|
+
},
|
|
29
37
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
{
|
|
39
|
+
settings: {
|
|
40
|
+
'vue-i18n': {
|
|
41
|
+
localeDir: './**/locales/*.{json,json5,yaml,yml}',
|
|
42
|
+
messageSyntaxVersion: '^9.0.0',
|
|
43
|
+
},
|
|
36
44
|
},
|
|
37
45
|
},
|
|
38
|
-
|
|
39
|
-
]);
|
|
46
|
+
]);
|