@alexlit/config-stylelint 67.0.2 → 68.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 +26 -16
- package/index.d.ts +0 -5
- package/index.js +0 -10
- package/package.json +3 -8
- package/plugins/media-use-custom-media.js +0 -18
- package/plugins/no-indistinguishable-colors.js +0 -18
- package/plugins/no-unresolved-module.js +0 -32
- package/plugins/selector-no-empty.js +0 -18
- package/plugins/use-nesting.js +0 -17
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Vue-файлов: настроенные правила из популярны
|
|
|
25
25
|
- [Приоритет настроек](#приоритет-настроек)
|
|
26
26
|
- [Общие настройки Stylelint](#общие-настройки-stylelint)
|
|
27
27
|
- [Проверки](#проверки)
|
|
28
|
+
- [Миграция с v67](#миграция-с-v67)
|
|
28
29
|
- [Миграция с v65](#миграция-с-v65)
|
|
29
30
|
- [Миграция с v63](#миграция-с-v63)
|
|
30
31
|
- [Миграция с v61](#миграция-с-v61)
|
|
@@ -37,6 +38,12 @@ Vue-файлов: настроенные правила из популярны
|
|
|
37
38
|
npm i @alexlit/config-stylelint -D
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
Или интерактивно, вместе с остальными пакетами:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @alexlit/lint-kit
|
|
45
|
+
```
|
|
46
|
+
|
|
40
47
|
## Быстрый старт
|
|
41
48
|
|
|
42
49
|
```js
|
|
@@ -126,7 +133,7 @@ export default defineConfig({
|
|
|
126
133
|
|
|
127
134
|
`--fix` сортирует CSS-переменные и свойства, приводит цвета к `rgb`, дополняет
|
|
128
135
|
`:hover` до `:hover, :focus` и переносит вложенные медиазапросы наверх. Проверки
|
|
129
|
-
|
|
136
|
+
БЭМ и логических свойств требуют ручной правки.
|
|
130
137
|
|
|
131
138
|
## Пример скриптов для package.json
|
|
132
139
|
|
|
@@ -156,14 +163,10 @@ export default defineConfig({
|
|
|
156
163
|
plugins.gamut(),
|
|
157
164
|
plugins.highPerformanceAnimation(),
|
|
158
165
|
plugins.logicalCss(),
|
|
159
|
-
plugins.mediaUseCustomMedia(),
|
|
160
166
|
plugins.noNestedMedia(),
|
|
161
|
-
plugins.noUnresolvedModule(),
|
|
162
167
|
plugins.noUnsupportedBrowserFeatures(),
|
|
163
168
|
plugins.order(),
|
|
164
169
|
plugins.scss(),
|
|
165
|
-
plugins.selectorNoEmpty(),
|
|
166
|
-
plugins.useNesting(),
|
|
167
170
|
plugins.vue(),
|
|
168
171
|
|
|
169
172
|
plugins.prettier(),
|
|
@@ -183,10 +186,8 @@ import { defineConfig, plugins } from '@alexlit/config-stylelint';
|
|
|
183
186
|
|
|
184
187
|
export default defineConfig({
|
|
185
188
|
plugins: [
|
|
186
|
-
plugins.
|
|
187
|
-
plugins.
|
|
188
|
-
rules: { 'plugin/no-unresolved-module': { alias: { '~': 'src' } } },
|
|
189
|
-
}),
|
|
189
|
+
plugins.scss({ rules: { 'scss/at-rule-no-unknown': null } }),
|
|
190
|
+
plugins.a11y({ rules: { 'a11y/no-obsolete-attribute': null } }),
|
|
190
191
|
],
|
|
191
192
|
});
|
|
192
193
|
```
|
|
@@ -206,9 +207,9 @@ import { defineConfig, plugins } from '@alexlit/config-stylelint';
|
|
|
206
207
|
|
|
207
208
|
export default defineConfig({
|
|
208
209
|
plugins: [
|
|
209
|
-
plugins.
|
|
210
|
+
plugins.scss({
|
|
210
211
|
overrides: [
|
|
211
|
-
{ files: ['**/*.vue'], rules: { '
|
|
212
|
+
{ files: ['**/*.vue'], rules: { 'scss/at-rule-no-unknown': null } },
|
|
212
213
|
],
|
|
213
214
|
}),
|
|
214
215
|
],
|
|
@@ -253,18 +254,27 @@ export default defineConfig({
|
|
|
253
254
|
| `plugins.gamut()` | Проверяет цвета на выход за пределы цветового охвата | [`stylelint-gamut`](https://github.com/fpetrakov/stylelint-gamut) |
|
|
254
255
|
| `plugins.highPerformanceAnimation()` | Запрещает анимации, нагружающие рендеринг | [`stylelint-high-performance-animation`](https://github.com/kristerkari/stylelint-high-performance-animation) |
|
|
255
256
|
| `plugins.logicalCss()` | Проверяет использование логических CSS-свойств | [`stylelint-plugin-logical-css`](https://github.com/yuschick/stylelint-plugin-logical-css) |
|
|
256
|
-
| `plugins.mediaUseCustomMedia()` | Требует использования кастомных медиа-запросов | [`stylelint-media-use-custom-media`](https://github.com/csstools/stylelint-media-use-custom-media) |
|
|
257
|
-
| `plugins.noIndistinguishableColors()` | Запрещает неразличимые цвета | [`stylelint-no-indistinguishable-colors`](https://github.com/ierhyna/stylelint-no-indistinguishable-colors) |
|
|
258
257
|
| `plugins.noNestedMedia()` | Запрещает вложенные медиа-запросы | [`stylelint-no-nested-media`](https://github.com/dkrnl/stylelint-no-nested-media) |
|
|
259
|
-
| `plugins.noUnresolvedModule()` | Проверяет разрешение импортов | [`stylelint-no-unresolved-module`](https://github.com/niksy/stylelint-no-unresolved-module) |
|
|
260
258
|
| `plugins.noUnsupportedBrowserFeatures()` | Проверяет поддержку CSS-функций целевыми браузерами | [`stylelint-no-unsupported-browser-features`](https://github.com/ismay/stylelint-no-unsupported-browser-features) |
|
|
261
259
|
| `plugins.order()` | Настраивает порядок свойств и селекторов | [`stylelint-order`](https://github.com/hudochenkov/stylelint-order) |
|
|
262
260
|
| `plugins.prettier()` | Интегрирует Prettier | [`stylelint-prettier`](https://github.com/prettier/stylelint-prettier) |
|
|
263
261
|
| `plugins.scss()` | Настраивает линтинг SCSS | [`stylelint-scss`](https://github.com/kristerkari/stylelint-scss) |
|
|
264
|
-
| `plugins.selectorNoEmpty()` | Запрещает пустые селекторы | [`stylelint-selector-no-empty`](https://github.com/ssivanatarajan/stylelint-selector-no-empty) |
|
|
265
|
-
| `plugins.useNesting()` | Требует использования CSS-вложенности | [`stylelint-use-nesting`](https://github.com/csstools/stylelint-use-nesting) |
|
|
266
262
|
| `plugins.vue()` | Подключает поддержку Vue.js SFC | [`stylelint-config-recommended-vue`](https://github.com/ota-meshi/stylelint-config-recommended-vue) |
|
|
267
263
|
|
|
264
|
+
## Миграция с v67
|
|
265
|
+
|
|
266
|
+
v68 - breaking-релиз: удалены проверки `plugins.noUnresolvedModule()`,
|
|
267
|
+
`plugins.selectorNoEmpty()`, `plugins.mediaUseCustomMedia()`,
|
|
268
|
+
`plugins.useNesting()` и `plugins.noIndistinguishableColors()`.
|
|
269
|
+
|
|
270
|
+
Их пакеты несовместимы со Stylelint 18: peer-диапазоны
|
|
271
|
+
`^14 || ^15 || ^16 || ^17`, `^14.9.1`, `^11.1.1 || ... || ^16.0.0`, а также
|
|
272
|
+
`> 18` (в semver это `>=19.0.0`) не пересекаются с `stylelint@18`. Из-за этого
|
|
273
|
+
npm уходил в `ERESOLVE` и не мог построить дерево зависимостей.
|
|
274
|
+
|
|
275
|
+
Если эти проверки нужны, подключайте их самостоятельно. Для Stylelint 18
|
|
276
|
+
потребуется `legacy-peer-deps` и совместимая версия плагина.
|
|
277
|
+
|
|
268
278
|
## Миграция с v65
|
|
269
279
|
|
|
270
280
|
v66 - breaking-релиз: позиционные аргументы заменены одним объектом.
|
package/index.d.ts
CHANGED
|
@@ -22,16 +22,11 @@ interface Plugins {
|
|
|
22
22
|
gamut: (options?: PluginOptions) => Config;
|
|
23
23
|
highPerformanceAnimation: (options?: PluginOptions) => Config;
|
|
24
24
|
logicalCss: (options?: PluginOptions) => Config;
|
|
25
|
-
mediaUseCustomMedia: (options?: PluginOptions) => Config;
|
|
26
|
-
noIndistinguishableColors: (options?: PluginOptions) => Config;
|
|
27
25
|
noNestedMedia: (options?: PluginOptions) => Config;
|
|
28
|
-
noUnresolvedModule: (options?: PluginOptions) => Config;
|
|
29
26
|
noUnsupportedBrowserFeatures: (options?: PluginOptions) => Config;
|
|
30
27
|
order: (options?: PluginOptions) => Config;
|
|
31
28
|
prettier: (options?: PluginOptions) => Config;
|
|
32
29
|
scss: (options?: PluginOptions) => Config;
|
|
33
|
-
selectorNoEmpty: (options?: PluginOptions) => Config;
|
|
34
|
-
useNesting: (options?: PluginOptions) => Config;
|
|
35
30
|
vue: (options?: PluginOptions) => Config;
|
|
36
31
|
}
|
|
37
32
|
|
package/index.js
CHANGED
|
@@ -6,16 +6,11 @@ import { declarationBlockNoIgnoredProperties } from './plugins/declaration-block
|
|
|
6
6
|
import { gamut } from './plugins/gamut.js';
|
|
7
7
|
import { highPerformanceAnimation } from './plugins/high-performance-animation.js';
|
|
8
8
|
import { logicalCss } from './plugins/logical-css.js';
|
|
9
|
-
import { mediaUseCustomMedia } from './plugins/media-use-custom-media.js';
|
|
10
|
-
import { noIndistinguishableColors } from './plugins/no-indistinguishable-colors.js';
|
|
11
9
|
import { noNestedMedia } from './plugins/no-nested-media.js';
|
|
12
|
-
import { noUnresolvedModule } from './plugins/no-unresolved-module.js';
|
|
13
10
|
import { noUnsupportedBrowserFeatures } from './plugins/no-unsupported-browser-features.js';
|
|
14
11
|
import { order } from './plugins/order.js';
|
|
15
12
|
import { prettier } from './plugins/prettier.js';
|
|
16
13
|
import { scss } from './plugins/scss.js';
|
|
17
|
-
import { selectorNoEmpty } from './plugins/selector-no-empty.js';
|
|
18
|
-
import { useNesting } from './plugins/use-nesting.js';
|
|
19
14
|
import { vue } from './plugins/vue.js';
|
|
20
15
|
import { mergeConfigs } from './utils/merge-configs.js';
|
|
21
16
|
|
|
@@ -28,16 +23,11 @@ const plugins = {
|
|
|
28
23
|
gamut,
|
|
29
24
|
highPerformanceAnimation,
|
|
30
25
|
logicalCss,
|
|
31
|
-
mediaUseCustomMedia,
|
|
32
|
-
noIndistinguishableColors,
|
|
33
26
|
noNestedMedia,
|
|
34
|
-
noUnresolvedModule,
|
|
35
27
|
noUnsupportedBrowserFeatures,
|
|
36
28
|
order,
|
|
37
29
|
prettier,
|
|
38
30
|
scss,
|
|
39
|
-
selectorNoEmpty,
|
|
40
|
-
useNesting,
|
|
41
31
|
vue,
|
|
42
32
|
};
|
|
43
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-stylelint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "68.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Stylelint config",
|
|
6
6
|
"keywords": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"utils"
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
|
-
"lint": "cd ../../ && ./scripts/lint.
|
|
35
|
+
"lint": "cd ../../ && ./scripts/lint.css.sh",
|
|
36
36
|
"ou": "../../scripts/ou.sh",
|
|
37
37
|
"release": "../../scripts/release.sh",
|
|
38
38
|
"semver": "../../scripts/semver.sh",
|
|
@@ -52,17 +52,12 @@
|
|
|
52
52
|
"stylelint-declaration-block-no-ignored-properties": "^3.1.0",
|
|
53
53
|
"stylelint-gamut": "^2.0.2",
|
|
54
54
|
"stylelint-high-performance-animation": "^2.1.0",
|
|
55
|
-
"stylelint-media-use-custom-media": "^4.1.0",
|
|
56
|
-
"stylelint-no-indistinguishable-colors": "^2.3.1",
|
|
57
55
|
"stylelint-no-nested-media": "^0.1.0",
|
|
58
|
-
"stylelint-no-unresolved-module": "^2.6.0",
|
|
59
56
|
"stylelint-no-unsupported-browser-features": "^8.1.2",
|
|
60
57
|
"stylelint-order": "^9.0.0",
|
|
61
58
|
"stylelint-plugin-logical-css": "^2.1.1",
|
|
62
59
|
"stylelint-prettier": "^5.1.0",
|
|
63
|
-
"stylelint-scss": "^7.5.0"
|
|
64
|
-
"stylelint-selector-no-empty": "^1.0.9",
|
|
65
|
-
"stylelint-use-nesting": "^6.0.2"
|
|
60
|
+
"stylelint-scss": "^7.5.0"
|
|
66
61
|
},
|
|
67
62
|
"engines": {
|
|
68
63
|
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { mergeConfigs } from '../utils/merge-configs.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
plugins: ['stylelint-media-use-custom-media'],
|
|
5
|
-
rules: { 'csstools/media-use-custom-media': 'always' },
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Требует использования кастомных медиа-запросов.
|
|
10
|
-
*
|
|
11
|
-
* @param {Partial<import('stylelint').Config>} [options]
|
|
12
|
-
*
|
|
13
|
-
* @returns {import('stylelint').Config}
|
|
14
|
-
*
|
|
15
|
-
* @see [stylelint-media-use-custom-media](https://github.com/csstools/stylelint-media-use-custom-media)
|
|
16
|
-
*/
|
|
17
|
-
export const mediaUseCustomMedia = (options = {}) =>
|
|
18
|
-
mergeConfigs(DEFAULTS, options);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { mergeConfigs } from '../utils/merge-configs.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
plugins: ['stylelint-no-indistinguishable-colors'],
|
|
5
|
-
rules: { 'plugin/stylelint-no-indistinguishable-colors': true },
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Запрещает неразличимые цвета.
|
|
10
|
-
*
|
|
11
|
-
* @param {Partial<import('stylelint').Config>} [options]
|
|
12
|
-
*
|
|
13
|
-
* @returns {import('stylelint').Config}
|
|
14
|
-
*
|
|
15
|
-
* @see [stylelint-no-indistinguishable-colors](https://github.com/ierhyna/stylelint-no-indistinguishable-colors)
|
|
16
|
-
*/
|
|
17
|
-
export const noIndistinguishableColors = (options = {}) =>
|
|
18
|
-
mergeConfigs(DEFAULTS, options);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { mergeConfigs } from '../utils/merge-configs.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
plugins: ['stylelint-no-unresolved-module'],
|
|
5
|
-
rules: {
|
|
6
|
-
'plugin/no-unresolved-module': {
|
|
7
|
-
alias: { '~assets': 'assets', '~public': 'public', '~static': 'static' },
|
|
8
|
-
modules: [
|
|
9
|
-
'assets',
|
|
10
|
-
'node_modules',
|
|
11
|
-
'public',
|
|
12
|
-
'src',
|
|
13
|
-
'src/assets',
|
|
14
|
-
'src/public',
|
|
15
|
-
'src/static',
|
|
16
|
-
'static',
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Проверяет разрешение импортов.
|
|
24
|
-
*
|
|
25
|
-
* @param {Partial<import('stylelint').Config>} [options]
|
|
26
|
-
*
|
|
27
|
-
* @returns {import('stylelint').Config}
|
|
28
|
-
*
|
|
29
|
-
* @see [stylelint-no-unresolved-module](https://github.com/niksy/stylelint-no-unresolved-module)
|
|
30
|
-
*/
|
|
31
|
-
export const noUnresolvedModule = (options = {}) =>
|
|
32
|
-
mergeConfigs(DEFAULTS, options);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { mergeConfigs } from '../utils/merge-configs.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
plugins: ['stylelint-selector-no-empty'],
|
|
5
|
-
rules: { 'plugin/stylelint-selector-no-empty': true },
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Запрещает пустые селекторы.
|
|
10
|
-
*
|
|
11
|
-
* @param {Partial<import('stylelint').Config>} [options]
|
|
12
|
-
*
|
|
13
|
-
* @returns {import('stylelint').Config}
|
|
14
|
-
*
|
|
15
|
-
* @see [stylelint-selector-no-empty](https://github.com/ssivanatarajan/stylelint-selector-no-empty)
|
|
16
|
-
*/
|
|
17
|
-
export const selectorNoEmpty = (options = {}) =>
|
|
18
|
-
mergeConfigs(DEFAULTS, options);
|
package/plugins/use-nesting.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { mergeConfigs } from '../utils/merge-configs.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULTS = {
|
|
4
|
-
plugins: ['stylelint-use-nesting'],
|
|
5
|
-
rules: { 'csstools/use-nesting': ['always', { except: [], syntax: 'scss' }] },
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Требует использования CSS-вложенности.
|
|
10
|
-
*
|
|
11
|
-
* @param {Partial<import('stylelint').Config>} [options]
|
|
12
|
-
*
|
|
13
|
-
* @returns {import('stylelint').Config}
|
|
14
|
-
*
|
|
15
|
-
* @see [stylelint-use-nesting](https://github.com/csstools/stylelint-use-nesting)
|
|
16
|
-
*/
|
|
17
|
-
export const useNesting = (options = {}) => mergeConfigs(DEFAULTS, options);
|