@alexlit/lint-kit 214.4.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 +19 -16
- 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 +4 -3
- 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
|
@@ -6,11 +6,16 @@ const defineRules = createDefineRules({
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Настраивает линтинг по методологии БЭМ.
|
|
10
|
+
*
|
|
11
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
12
|
+
* поверх значений по умолчанию (shallow merge)
|
|
13
|
+
*
|
|
14
|
+
* @returns {import('stylelint').Config}
|
|
10
15
|
*
|
|
11
16
|
* @see [@morev/stylelint-plugin](https://morevm.github.io/stylelint-plugin/)
|
|
12
17
|
*/
|
|
13
|
-
export
|
|
18
|
+
export const bem = (options = {}) => ({
|
|
14
19
|
overrides: [
|
|
15
20
|
{
|
|
16
21
|
files: ['**/*.{css,scss,vue}'],
|
|
@@ -40,4 +45,6 @@ export default {
|
|
|
40
45
|
},
|
|
41
46
|
],
|
|
42
47
|
plugins: ['@morev/stylelint-plugin'],
|
|
43
|
-
|
|
48
|
+
|
|
49
|
+
...options,
|
|
50
|
+
});
|
|
@@ -168,8 +168,18 @@ const rule = function (actual, options, context) {
|
|
|
168
168
|
rule.ruleName = ruleName;
|
|
169
169
|
rule.messages = messages;
|
|
170
170
|
|
|
171
|
-
/**
|
|
172
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Нормализует формат цветов (hex → rgb/hsl).
|
|
173
|
+
*
|
|
174
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
175
|
+
* поверх значений по умолчанию (shallow merge)
|
|
176
|
+
*
|
|
177
|
+
* @returns {import('stylelint').Config}
|
|
178
|
+
*/
|
|
179
|
+
export const colorFormat = (options = {}) => ({
|
|
173
180
|
plugins: [createPlugin(ruleName, rule)],
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
|
|
182
|
+
...options,
|
|
183
|
+
|
|
184
|
+
rules: { 'color-format/format': { format: 'rgb' }, ...options.rules },
|
|
185
|
+
});
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Запрещает бесполезные свойства в блоке объявлений.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-declaration-block-no-ignored-properties](https://github.com/kristerkari/stylelint-declaration-block-no-ignored-properties)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const declarationBlockNoIgnoredProperties = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-declaration-block-no-ignored-properties'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
'plugin/declaration-block-no-ignored-properties': true,
|
|
18
|
+
...options.rules,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Проверяет цвета на выход за пределы цветового охвата (gamut).
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-gamut](https://github.com/fpetrakov/stylelint-gamut)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const gamut = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-gamut'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: { 'gamut/color-no-out-gamut-range': true, ...options.rules },
|
|
17
|
+
});
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Запрещает анимации, нагружающие рендеринг.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-high-performance-animation](https://github.com/kristerkari/stylelint-high-performance-animation)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const highPerformanceAnimation = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-high-performance-animation'],
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
8
16
|
rules: {
|
|
9
17
|
'plugin/no-low-performance-animation-properties': [
|
|
10
18
|
true,
|
|
11
19
|
{ ignore: 'paint-properties', ignoreProperties: [] },
|
|
12
20
|
],
|
|
21
|
+
...options.rules,
|
|
13
22
|
},
|
|
14
|
-
};
|
|
23
|
+
});
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Проверяет использование логических CSS-свойств.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-plugin-logical-css](https://github.com/yuschick/stylelint-plugin-logical-css)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const logicalCss = (options = {}) => ({
|
|
7
12
|
extends: ['stylelint-plugin-logical-css/configs/recommended'],
|
|
8
13
|
plugins: ['stylelint-plugin-logical-css'],
|
|
9
|
-
|
|
14
|
+
|
|
15
|
+
...options,
|
|
16
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Требует использования кастомных медиа-запросов.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-media-use-custom-media](https://github.com/csstools/stylelint-media-use-custom-media)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const mediaUseCustomMedia = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-media-use-custom-media'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: { 'csstools/media-use-custom-media': 'always', ...options.rules },
|
|
17
|
+
});
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Запрещает неразличимые цвета.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-no-indistinguishable-colors](https://github.com/ierhyna/stylelint-no-indistinguishable-colors)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const noIndistinguishableColors = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-no-indistinguishable-colors'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
'plugin/stylelint-no-indistinguishable-colors': true,
|
|
18
|
+
...options.rules,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Запрещает вложенные медиа-запросы.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-no-nested-media](https://github.com/dkrnl/stylelint-no-nested-media)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const noNestedMedia = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-no-nested-media'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: { 'pitcher/no-nested-media': true, ...options.rules },
|
|
17
|
+
});
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Проверяет разрешение импортов.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-no-unresolved-module](https://github.com/niksy/stylelint-no-unresolved-module)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const noUnresolvedModule = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-no-unresolved-module'],
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
8
16
|
rules: {
|
|
9
17
|
'plugin/no-unresolved-module': {
|
|
10
18
|
alias: { '~assets': 'assets', '~public': 'public', '~static': 'static' },
|
|
@@ -19,5 +27,6 @@ export default {
|
|
|
19
27
|
'static',
|
|
20
28
|
],
|
|
21
29
|
},
|
|
30
|
+
...options.rules,
|
|
22
31
|
},
|
|
23
|
-
};
|
|
32
|
+
});
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Проверяет поддержку CSS-функций целевыми браузерами.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-no-unsupported-browser-features](https://github.com/ismay/stylelint-no-unsupported-browser-features)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const noUnsupportedBrowserFeatures = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-no-unsupported-browser-features'],
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
8
16
|
rules: {
|
|
9
17
|
'plugin/no-unsupported-browser-features': [
|
|
10
18
|
true,
|
|
@@ -14,5 +22,6 @@ export default {
|
|
|
14
22
|
severity: 'warning',
|
|
15
23
|
},
|
|
16
24
|
],
|
|
25
|
+
...options.rules,
|
|
17
26
|
},
|
|
18
|
-
};
|
|
27
|
+
});
|
|
@@ -116,12 +116,20 @@ const buildPseudoElementRules = () => [
|
|
|
116
116
|
];
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Настраивает порядок свойств и селекторов.
|
|
120
|
+
*
|
|
121
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
122
|
+
* поверх значений по умолчанию (shallow merge)
|
|
123
|
+
*
|
|
124
|
+
* @returns {import('stylelint').Config}
|
|
120
125
|
*
|
|
121
126
|
* @see [stylelint-order](https://github.com/hudochenkov/stylelint-order)
|
|
122
127
|
*/
|
|
123
|
-
export
|
|
128
|
+
export const order = (options = {}) => ({
|
|
124
129
|
plugins: ['stylelint-order'],
|
|
130
|
+
|
|
131
|
+
...options,
|
|
132
|
+
|
|
125
133
|
rules: {
|
|
126
134
|
'order/custom-properties-alphabetical-order': true,
|
|
127
135
|
'order/order': [
|
|
@@ -190,5 +198,7 @@ export default {
|
|
|
190
198
|
...buildLetterRules('__'),
|
|
191
199
|
],
|
|
192
200
|
'order/properties-alphabetical-order': true,
|
|
201
|
+
|
|
202
|
+
...options.rules,
|
|
193
203
|
},
|
|
194
|
-
};
|
|
204
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Интегрирует Prettier.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-prettier](https://github.com/prettier/stylelint-prettier)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const prettier = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-prettier'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: { 'prettier/prettier': true, ...options.rules },
|
|
17
|
+
});
|
|
@@ -3,13 +3,21 @@
|
|
|
3
3
|
const KEBAB_CASE_PATTERN = '^[a-z]+([a-z0-9-]+[a-z0-9]+)?$';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Настраивает линтинг SCSS.
|
|
7
|
+
*
|
|
8
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
9
|
+
* поверх значений по умолчанию (shallow merge)
|
|
10
|
+
*
|
|
11
|
+
* @returns {import('stylelint').Config}
|
|
7
12
|
*
|
|
8
13
|
* @see [stylelint-scss](https://github.com/kristerkari/stylelint-scss)
|
|
9
14
|
*/
|
|
10
|
-
export
|
|
15
|
+
export const scss = (options = {}) => ({
|
|
11
16
|
extends: ['stylelint-config-standard-scss'],
|
|
12
17
|
plugins: ['stylelint-scss'],
|
|
18
|
+
|
|
19
|
+
...options,
|
|
20
|
+
|
|
13
21
|
rules: {
|
|
14
22
|
'scss/at-each-key-value-single-line': true,
|
|
15
23
|
'scss/at-else-if-parentheses-space-before': 'always',
|
|
@@ -92,5 +100,7 @@ export default {
|
|
|
92
100
|
true,
|
|
93
101
|
{ ignoreKeywords: [] },
|
|
94
102
|
],
|
|
103
|
+
|
|
104
|
+
...options.rules,
|
|
95
105
|
},
|
|
96
|
-
};
|
|
106
|
+
});
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Запрещает пустые селекторы.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-selector-no-empty](https://github.com/ssivanatarajan/stylelint-selector-no-empty)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const selectorNoEmpty = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-selector-no-empty'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: { 'plugin/stylelint-selector-no-empty': true, ...options.rules },
|
|
17
|
+
});
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Требует использования CSS-вложенности.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-use-nesting](https://github.com/csstools/stylelint-use-nesting)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const useNesting = (options = {}) => ({
|
|
7
12
|
plugins: ['stylelint-use-nesting'],
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
|
|
16
|
+
rules: {
|
|
17
|
+
'csstools/use-nesting': ['always', { except: [], syntax: 'scss' }],
|
|
18
|
+
...options.rules,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Подключает поддержку Vue.js SFC.
|
|
3
|
+
*
|
|
4
|
+
* @param {Partial<import('stylelint').Config>} [options] - Опции, накладываемые
|
|
5
|
+
* поверх значений по умолчанию (shallow merge)
|
|
6
|
+
*
|
|
7
|
+
* @returns {import('stylelint').Config}
|
|
3
8
|
*
|
|
4
9
|
* @see [stylelint-config-recommended-vue](https://github.com/ota-meshi/stylelint-config-recommended-vue)
|
|
5
10
|
*/
|
|
6
|
-
export
|
|
11
|
+
export const vue = (options = {}) => ({
|
|
12
|
+
extends: 'stylelint-config-recommended-vue',
|
|
13
|
+
|
|
14
|
+
...options,
|
|
15
|
+
});
|
package/prettier.config.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineConfig, plugins } from '@alexlit/config-prettier';
|
|
2
2
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
export default defineConfig([
|
|
4
|
+
plugins.jsdoc(),
|
|
5
|
+
plugins.mdc(),
|
|
6
|
+
plugins.packageJson(),
|
|
7
|
+
plugins.php(),
|
|
8
|
+
plugins.pug(),
|
|
9
|
+
plugins.ruby(),
|
|
10
|
+
plugins.sh(),
|
|
11
|
+
plugins.sortJson(),
|
|
12
|
+
plugins.solidity(),
|
|
13
|
+
plugins.sql(),
|
|
14
|
+
plugins.tailwindcss(),
|
|
15
|
+
plugins.xml(),
|
|
16
|
+
]);
|
package/scripts/semver.sh
CHANGED
|
@@ -44,17 +44,17 @@ done
|
|
|
44
44
|
|
|
45
45
|
echo -e "${YELLOW}Поднимаю ${GREEN}${VERSION}${YELLOW} версию пакета ${GREEN}${CURRENT_PACKAGE_NAME}${YELLOW}...${WHITE}"
|
|
46
46
|
|
|
47
|
-
# Базовый тег
|
|
47
|
+
# Базовый тег - последний релиз ТОЛЬКО этого пакета (в монорепо git-теги глобальные)
|
|
48
48
|
LAST_PACKAGE_TAG=$(git describe --tags --abbrev=0 --match "${CURRENT_PACKAGE_NAME}@*" 2> /dev/null || true)
|
|
49
49
|
|
|
50
50
|
# --bump (а не --release): поднимает версию, но НЕ делает коммит/тег/GitHub
|
|
51
|
-
# release
|
|
51
|
+
# release - их делаем сами ниже, ПОСЛЕ коммита бампа
|
|
52
52
|
CHANGELOGEN_ARGS=(--${VERSION} --bump)
|
|
53
53
|
if [ -n "${LAST_PACKAGE_TAG}" ]; then
|
|
54
54
|
CHANGELOGEN_ARGS+=(--from "${LAST_PACKAGE_TAG}")
|
|
55
55
|
fi
|
|
56
56
|
|
|
57
|
-
# CHANGELOG.md пишем только для корневого пакета, в сабмодулях
|
|
57
|
+
# CHANGELOG.md пишем только для корневого пакета, в сабмодулях - без него
|
|
58
58
|
if [ "${CURRENT_PACKAGE_NAME}" != "${MAIN_PACKAGE}" ]; then
|
|
59
59
|
CHANGELOGEN_ARGS+=(--no-output)
|
|
60
60
|
fi
|
package/stylelint.config.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineConfig, plugins } from '@alexlit/config-stylelint';
|
|
2
2
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export default defineConfig([
|
|
4
|
+
// Бывшие плагины по умолчанию (v61)
|
|
5
|
+
plugins.colorFormat(),
|
|
6
|
+
plugins.declarationBlockNoIgnoredProperties(),
|
|
7
|
+
plugins.highPerformanceAnimation(),
|
|
8
|
+
plugins.noNestedMedia(),
|
|
9
|
+
plugins.order(),
|
|
10
|
+
plugins.scss(),
|
|
11
|
+
plugins.selectorNoEmpty(),
|
|
12
|
+
plugins.useNesting(),
|
|
13
|
+
plugins.vue(),
|
|
14
|
+
|
|
15
|
+
// Включённые опциональные плагины
|
|
16
|
+
plugins.a11y(),
|
|
17
|
+
plugins.bem(),
|
|
18
|
+
plugins.gamut(),
|
|
19
|
+
plugins.logicalCss(),
|
|
20
|
+
plugins.mediaUseCustomMedia(),
|
|
21
|
+
plugins.noUnresolvedModule(),
|
|
22
|
+
plugins.noUnsupportedBrowserFeatures(),
|
|
23
|
+
|
|
24
|
+
// Кодстайл
|
|
25
|
+
plugins.prettier(),
|
|
26
|
+
]);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Alexey Litovchenko
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# ESLint Configuration
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
npm i @alexlit/config-eslint -D
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Connection
|
|
10
|
-
|
|
11
|
-
- Default
|
|
12
|
-
([see plugins enabled by default](https://github.com/alex-lit/lint-kit/blob/master/packages/config-eslint/index.js))
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
// .eslintrc.js
|
|
16
|
-
const { createConfig } = require('@alexlit/config-eslint');
|
|
17
|
-
|
|
18
|
-
module.exports = createConfig();
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- Custom
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
// .eslintrc.js
|
|
25
|
-
const {
|
|
26
|
-
createConfig,
|
|
27
|
-
extendSpellChecker,
|
|
28
|
-
} = require('@alexlit/config-eslint');
|
|
29
|
-
|
|
30
|
-
module.exports = createConfig(
|
|
31
|
-
{
|
|
32
|
-
// disable some default plugins
|
|
33
|
-
vitest: false,
|
|
34
|
-
|
|
35
|
-
// enable some optional plugins
|
|
36
|
-
node: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
// add custom rules
|
|
40
|
-
rules: {
|
|
41
|
-
'no-implicit-coercion': 'warn',
|
|
42
|
-
'spellcheck/spell-checker': extendSpellChecker({
|
|
43
|
-
skipWords: ['word1', 'word2'],
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
```
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module.exports = [
|
|
2
|
-
// html attributes
|
|
3
|
-
'allowfullscreen',
|
|
4
|
-
'allowpaymentrequest',
|
|
5
|
-
'async',
|
|
6
|
-
'autofocus',
|
|
7
|
-
'autoplay',
|
|
8
|
-
'checked',
|
|
9
|
-
'controls',
|
|
10
|
-
'default',
|
|
11
|
-
'defer',
|
|
12
|
-
'disabled',
|
|
13
|
-
'formnovalidate',
|
|
14
|
-
'hidden',
|
|
15
|
-
'ismap',
|
|
16
|
-
'itemscope',
|
|
17
|
-
'multiple',
|
|
18
|
-
'muted',
|
|
19
|
-
'nomodule',
|
|
20
|
-
'novalidate',
|
|
21
|
-
'open',
|
|
22
|
-
'playsinline',
|
|
23
|
-
'readonly',
|
|
24
|
-
'required',
|
|
25
|
-
'reversed',
|
|
26
|
-
'selected',
|
|
27
|
-
'truespeed',
|
|
28
|
-
|
|
29
|
-
// vuex store module registration
|
|
30
|
-
'namespaced',
|
|
31
|
-
|
|
32
|
-
// other
|
|
33
|
-
'enabled',
|
|
34
|
-
'invalid',
|
|
35
|
-
'loading',
|
|
36
|
-
'valid',
|
|
37
|
-
'value',
|
|
38
|
-
];
|