@itcase/lint 1.1.136 → 1.1.138
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 +20 -0
- package/dist/eslint/index.js +1 -1
- package/dist/eslint/perfectionist/index.js +1 -1
- package/dist/{sortUnionTypes_2NZizu0R.js → sortUnionTypes_C5VVNaF3.js} +1 -1
- package/dist/stylelint/index.d.ts +12 -1
- package/dist/stylelint/index.js +410 -0
- package/package.json +12 -12
- package/dist/stylelint/index2.js +0 -183
- package/dist/stylelint/index3.js +0 -349
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [1.1.138](https://github.com/ITCase/itcase-lint/compare/v1.1.137...v1.1.138) (2026-11-17)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **stylelint:** clone ast for selector checks and allow postcss-each property names ([d28d96b](https://github.com/ITCase/itcase-lint/commit/d28d96ba136b4e25b6e98f95f0dd7938209b98ca))
|
|
6
|
+
|
|
7
|
+
### Dependencies
|
|
8
|
+
|
|
9
|
+
* **other:** bump typescript-eslint, perfectionist, rollup, and lint-staged ([c3bfa62](https://github.com/ITCase/itcase-lint/commit/c3bfa625cd300555f109cf13dd736fb045a7f2d3))
|
|
10
|
+
|
|
11
|
+
## [1.1.137](https://github.com/ITCase/itcase-lint/compare/v1.1.136...v1.1.137) (2026-11-15)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **stylelint:** skip [@page](https://github.com/page) in property order and allow __next id ([d233217](https://github.com/ITCase/itcase-lint/commit/d233217896e1d43f345172bce9f62c3461d5ca84))
|
|
16
|
+
|
|
17
|
+
### Dependencies
|
|
18
|
+
|
|
19
|
+
* **other:** bump dependencies ([82f5f03](https://github.com/ITCase/itcase-lint/commit/82f5f035e2532ddbd785dd3a7107bfb23674107d))
|
|
20
|
+
|
|
1
21
|
## [1.1.136](https://github.com/ITCase/itcase-lint/compare/v1.1.135...v1.1.136) (2026-11-13)
|
|
2
22
|
|
|
3
23
|
### Features
|
package/dist/eslint/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import eslintReactHooks from 'eslint-plugin-react-hooks';
|
|
|
12
12
|
import eslintReactNative from 'eslint-plugin-react-native';
|
|
13
13
|
import globals from 'globals';
|
|
14
14
|
import eslintTypeScript from 'typescript-eslint';
|
|
15
|
-
import {
|
|
15
|
+
import { s as sortUnionTypes, a as sortObjectTypes, b as sortObjects, c as sortExports, d as sortNamedExports, e as sortMaps, f as sortJSXProps, g as sortIntersectionTypes, h as sortInterfaces, i as sortEnums } from '../sortUnionTypes_C5VVNaF3.js';
|
|
16
16
|
import parser from '@typescript-eslint/parser';
|
|
17
17
|
import { i as itcaseLintPlugin, p as pluginName, r as ruleName, a as pluginName$1, b as ruleName$1, s as storybookConfig } from '../index_CmQAJvhW.js';
|
|
18
18
|
import { noRestrictedSyntaxRestrictWords } from './restrictWords/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { i as sortEnums, c as sortExports, h as sortInterfaces, g as sortIntersectionTypes, f as sortJSXProps, e as sortMaps, d as sortNamedExports, a as sortObjectTypes, b as sortObjects, s as sortUnionTypes } from '../../sortUnionTypes_C5VVNaF3.js';
|
|
2
2
|
|
|
3
3
|
const sortClasses = [
|
|
4
4
|
'error',
|
|
@@ -547,4 +547,4 @@ const sortUnionTypes = [
|
|
|
547
547
|
},
|
|
548
548
|
];
|
|
549
549
|
|
|
550
|
-
export {
|
|
550
|
+
export { sortObjectTypes as a, sortObjects as b, sortExports as c, sortNamedExports as d, sortMaps as e, sortJSXProps as f, sortIntersectionTypes as g, sortInterfaces as h, sortEnums as i, sortUnionTypes as s };
|
|
@@ -2,7 +2,15 @@ import stylelint from 'stylelint';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
extends: string[];
|
|
4
4
|
ignoreFiles: string[];
|
|
5
|
-
plugins: (string |
|
|
5
|
+
plugins: (string | {
|
|
6
|
+
rule: stylelint.Rule;
|
|
7
|
+
ruleName: string;
|
|
8
|
+
} | {
|
|
9
|
+
default?: {
|
|
10
|
+
ruleName: string;
|
|
11
|
+
rule: stylelint.Rule;
|
|
12
|
+
};
|
|
13
|
+
})[];
|
|
6
14
|
rules: {
|
|
7
15
|
'max-nesting-depth': number;
|
|
8
16
|
'alpha-value-notation': (string | {
|
|
@@ -80,6 +88,9 @@ declare const _default: {
|
|
|
80
88
|
'selector-class-pattern': (string | {
|
|
81
89
|
severity: string;
|
|
82
90
|
})[];
|
|
91
|
+
'selector-id-pattern': (string | {
|
|
92
|
+
message: (selector: string) => string;
|
|
93
|
+
})[];
|
|
83
94
|
'selector-nested-pattern': (string | {
|
|
84
95
|
splitList: boolean;
|
|
85
96
|
})[];
|
package/dist/stylelint/index.js
CHANGED
|
@@ -1 +1,411 @@
|
|
|
1
|
+
import stylelint from 'stylelint';
|
|
2
|
+
import orderPlugins from 'stylelint-order';
|
|
1
3
|
|
|
4
|
+
// postcss-nested: ^& / ^^& / &^&. Не [attr^="..."] — там после ^ стоит =, не &.
|
|
5
|
+
const postcssNestedParentSelector = /(?:^|[\s>~+,])\^+&|&\^+&/;
|
|
6
|
+
// Кусок после &: БЭМ, псевдо, атрибут, класс или тег. $(token) из postcss-each.
|
|
7
|
+
const nestedSelectorChunk = '(?:(?:__|--|_|-)[\\w$().-]*|::[\\w-]+|:[\\w-]+(?:\\([^)]*\\))?|\\[[^\\]]+\\]|\\.[\\w$().-]+|[A-Za-z0-9]+)?';
|
|
8
|
+
const nestedSelectorPattern = [
|
|
9
|
+
'^(?:[a-z]+&+|\\.[a-z][\\w-]*&+|>\\s+\\^+&+|&+\\^+&+|\\^+&+|&+)',
|
|
10
|
+
nestedSelectorChunk,
|
|
11
|
+
'(?:\\s*[>~+]\\s+\\S+|\\s+\\S+|\\.[\\w$().-]+|::[\\w-]+|:[\\w-]+(?:\\([^)]*\\))?|\\[[^\\]]+\\]|',
|
|
12
|
+
'&+',
|
|
13
|
+
nestedSelectorChunk,
|
|
14
|
+
')*$',
|
|
15
|
+
].join('');
|
|
16
|
+
function readRuleSelector(ruleNode) {
|
|
17
|
+
const raw = ruleNode.raws.selector;
|
|
18
|
+
if (typeof raw === 'string' && raw)
|
|
19
|
+
return raw;
|
|
20
|
+
if (raw &&
|
|
21
|
+
typeof raw === 'object' &&
|
|
22
|
+
'raw' in raw &&
|
|
23
|
+
typeof raw.raw === 'string') {
|
|
24
|
+
return raw.raw;
|
|
25
|
+
}
|
|
26
|
+
return ruleNode.selector;
|
|
27
|
+
}
|
|
28
|
+
function collectParked(walkRules) {
|
|
29
|
+
const parked = [];
|
|
30
|
+
walkRules((ruleNode) => {
|
|
31
|
+
if (!postcssNestedParentSelector.test(readRuleSelector(ruleNode)))
|
|
32
|
+
return;
|
|
33
|
+
parked.push({
|
|
34
|
+
next: ruleNode.next(),
|
|
35
|
+
node: ruleNode,
|
|
36
|
+
parent: ruleNode.parent,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return parked;
|
|
40
|
+
}
|
|
41
|
+
// order/properties-order — порядок свойств компонента.
|
|
42
|
+
// У @page другие дескрипторы (size, margin, padding), их из проверки убираем.
|
|
43
|
+
function collectPageAtRules(walkAtRules) {
|
|
44
|
+
const parked = [];
|
|
45
|
+
walkAtRules((atRule) => {
|
|
46
|
+
parked.push({
|
|
47
|
+
next: atRule.next(),
|
|
48
|
+
node: atRule,
|
|
49
|
+
parent: atRule.parent,
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return parked;
|
|
53
|
+
}
|
|
54
|
+
function restorePageAtRules(parked) {
|
|
55
|
+
// С конца: соседний @page уже снова в дереве, insertBefore попадает в него.
|
|
56
|
+
for (let index = parked.length - 1; index >= 0; index -= 1) {
|
|
57
|
+
const item = parked[index];
|
|
58
|
+
if (!item.parent)
|
|
59
|
+
continue;
|
|
60
|
+
if (item.next && item.next.parent === item.parent) {
|
|
61
|
+
item.parent.insertBefore(item.next, item.node);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
item.parent.append(item.node);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function skipPageDescriptors(orderRule) {
|
|
69
|
+
const wrapped = (primary, secondaryOptions, context) => {
|
|
70
|
+
return (root, result) => {
|
|
71
|
+
const parked = collectPageAtRules((callback) => {
|
|
72
|
+
root.walkAtRules('page', callback);
|
|
73
|
+
});
|
|
74
|
+
for (let index = parked.length - 1; index >= 0; index -= 1) {
|
|
75
|
+
parked[index].node.remove();
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const outcome = orderRule(primary, secondaryOptions, context)(root, result);
|
|
79
|
+
if (outcome instanceof Promise) {
|
|
80
|
+
return outcome.finally(() => {
|
|
81
|
+
restorePageAtRules(parked);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
restorePageAtRules(parked);
|
|
85
|
+
return outcome;
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
restorePageAtRules(parked);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
return Object.assign(wrapped, {
|
|
94
|
+
messages: orderRule.messages,
|
|
95
|
+
meta: orderRule.meta,
|
|
96
|
+
primaryOptionArray: orderRule.primaryOptionArray,
|
|
97
|
+
ruleName: orderRule.ruleName,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// css-tree в selector-no-invalid не парсит ^&. Снимаем такие правила на время проверки.
|
|
101
|
+
const selectorNoInvalidRuleName = 'itcase/selector-no-invalid';
|
|
102
|
+
const selectorNoInvalidRule = Object.assign((primary, _secondaryOptions, context) => {
|
|
103
|
+
return async (root, result) => {
|
|
104
|
+
if (primary !== true)
|
|
105
|
+
return;
|
|
106
|
+
// Клон: правила stylelint идут параллельно и видят один root.
|
|
107
|
+
// Снимать ^& с оригинала нельзя — пропадают проверки свойств внутри.
|
|
108
|
+
const clone = root.clone();
|
|
109
|
+
const parked = collectParked((callback) => {
|
|
110
|
+
clone.walkRules(callback);
|
|
111
|
+
});
|
|
112
|
+
for (let index = parked.length - 1; index >= 0; index -= 1) {
|
|
113
|
+
parked[index].node.remove();
|
|
114
|
+
}
|
|
115
|
+
const coreRule = await stylelint.rules['selector-no-invalid'];
|
|
116
|
+
await coreRule(true, {}, context)(clone, result);
|
|
117
|
+
};
|
|
118
|
+
}, {
|
|
119
|
+
messages: {},
|
|
120
|
+
ruleName: selectorNoInvalidRuleName,
|
|
121
|
+
});
|
|
122
|
+
// eslint-disable-next-line import/no-default-export
|
|
123
|
+
var index = {
|
|
124
|
+
extends: ['stylelint-config-standard'],
|
|
125
|
+
ignoreFiles: [
|
|
126
|
+
'**/__*.css',
|
|
127
|
+
'**/import.css',
|
|
128
|
+
'**/vendor/**/*.css',
|
|
129
|
+
'**/vendor/*.css',
|
|
130
|
+
'__*.css',
|
|
131
|
+
'**/*.ts',
|
|
132
|
+
'**/*.tsx',
|
|
133
|
+
'**/*.js',
|
|
134
|
+
'**/*.jsx',
|
|
135
|
+
'**/*.mjs',
|
|
136
|
+
'**/*.md',
|
|
137
|
+
'ios/**/*',
|
|
138
|
+
'android/**/*',
|
|
139
|
+
],
|
|
140
|
+
plugins: [
|
|
141
|
+
'stylelint-prettier',
|
|
142
|
+
...orderPlugins.map((plugin) => {
|
|
143
|
+
if (plugin.ruleName !== 'order/properties-order')
|
|
144
|
+
return plugin;
|
|
145
|
+
return stylelint.createPlugin(plugin.ruleName, skipPageDescriptors(plugin.rule));
|
|
146
|
+
}),
|
|
147
|
+
'stylelint-no-unsupported-browser-features',
|
|
148
|
+
stylelint.createPlugin(selectorNoInvalidRuleName, selectorNoInvalidRule),
|
|
149
|
+
],
|
|
150
|
+
rules: {
|
|
151
|
+
'max-nesting-depth': 20,
|
|
152
|
+
'alpha-value-notation': [
|
|
153
|
+
'number',
|
|
154
|
+
{
|
|
155
|
+
exceptProperties: ['opacity'],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
'at-rule-empty-line-before': [
|
|
159
|
+
'always',
|
|
160
|
+
{
|
|
161
|
+
except: ['inside-block'],
|
|
162
|
+
ignore: [
|
|
163
|
+
'after-comment',
|
|
164
|
+
'first-nested',
|
|
165
|
+
'blockless-after-same-name-blockless',
|
|
166
|
+
'blockless-after-blockless',
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
],
|
|
170
|
+
'at-rule-no-unknown': [
|
|
171
|
+
true,
|
|
172
|
+
{
|
|
173
|
+
ignoreAtRules: [
|
|
174
|
+
'import-glob',
|
|
175
|
+
'for',
|
|
176
|
+
'each',
|
|
177
|
+
'mixin',
|
|
178
|
+
'extend',
|
|
179
|
+
'define-mixin',
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
'block-no-empty': null,
|
|
184
|
+
'color-function-notation': 'legacy',
|
|
185
|
+
'color-no-hex': true,
|
|
186
|
+
'comment-empty-line-before': [
|
|
187
|
+
'always',
|
|
188
|
+
{
|
|
189
|
+
except: ['first-nested'],
|
|
190
|
+
ignore: ['after-comment'],
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
'custom-property-empty-line-before': null,
|
|
194
|
+
// kebab-case и _, плюс $(token) из postcss-each.
|
|
195
|
+
// value-parser режет $(token) внутри var(): имя доходит как префикс с $ на конце.
|
|
196
|
+
'custom-property-pattern': '^(?:[a-z]|\\$\\([A-Za-z0-9_-]+\\))(?:[a-z0-9_-]|\\$\\([A-Za-z0-9_-]+\\))*\\$?$',
|
|
197
|
+
'declaration-empty-line-before': 'never',
|
|
198
|
+
'declaration-property-value-no-unknown': [
|
|
199
|
+
true,
|
|
200
|
+
{
|
|
201
|
+
ignoreProperties: {
|
|
202
|
+
top: '/.+/',
|
|
203
|
+
right: '/.+/',
|
|
204
|
+
bottom: '/.+/',
|
|
205
|
+
left: '/.+/',
|
|
206
|
+
border: '/.+/',
|
|
207
|
+
margin: '/.+/',
|
|
208
|
+
padding: '/.+/',
|
|
209
|
+
gap: '/.+/',
|
|
210
|
+
'/-gap$/': '/.+/',
|
|
211
|
+
'/^border-/': '/.+/',
|
|
212
|
+
'/^margin-/': '/.+/',
|
|
213
|
+
'/^padding-/': '/.+/',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
'function-no-unknown': [true, { ignoreFunctions: ['$', 'fluid'] }],
|
|
218
|
+
'function-url-quotes': 'always',
|
|
219
|
+
'hue-degree-notation': 'number',
|
|
220
|
+
'import-notation': 'string',
|
|
221
|
+
'itcase/selector-no-invalid': true,
|
|
222
|
+
'keyframes-name-pattern': [
|
|
223
|
+
'^([a-z]+)([A-Z]?[a-z]+)+$',
|
|
224
|
+
{ message: 'Expected keyframe name to be camelCase' },
|
|
225
|
+
],
|
|
226
|
+
'no-descending-specificity': null,
|
|
227
|
+
'order/order': [
|
|
228
|
+
[
|
|
229
|
+
'declarations',
|
|
230
|
+
{
|
|
231
|
+
type: 'at-rule',
|
|
232
|
+
name: 'extend',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: 'at-rule',
|
|
236
|
+
name: 'mixin',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: 'at-rule',
|
|
240
|
+
name: 'media',
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
type: 'rule',
|
|
244
|
+
selector: '^&::(before|after)',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: 'rule',
|
|
248
|
+
selector: '^&:\\w',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
type: 'rule',
|
|
252
|
+
selector: '^&_',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: 'rule',
|
|
256
|
+
selector: '^.',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
{
|
|
260
|
+
unspecified: 'bottom',
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
'order/properties-order': [
|
|
264
|
+
[
|
|
265
|
+
'width',
|
|
266
|
+
'height',
|
|
267
|
+
'min-width',
|
|
268
|
+
'min-height',
|
|
269
|
+
'max-width',
|
|
270
|
+
'max-height',
|
|
271
|
+
'aspect-ratio',
|
|
272
|
+
'font',
|
|
273
|
+
'font-size',
|
|
274
|
+
'font-range',
|
|
275
|
+
'font-weight',
|
|
276
|
+
'color',
|
|
277
|
+
'text-shadow',
|
|
278
|
+
'text-decoration',
|
|
279
|
+
'text-transform',
|
|
280
|
+
'text-align',
|
|
281
|
+
'text-rendering',
|
|
282
|
+
'white-space',
|
|
283
|
+
'line-height',
|
|
284
|
+
'line-height-range',
|
|
285
|
+
'letter-spacing',
|
|
286
|
+
'background',
|
|
287
|
+
'background-position',
|
|
288
|
+
'background-repeat',
|
|
289
|
+
'background-size',
|
|
290
|
+
'padding',
|
|
291
|
+
'margin',
|
|
292
|
+
'border',
|
|
293
|
+
'border-width',
|
|
294
|
+
'border-color',
|
|
295
|
+
'border-style',
|
|
296
|
+
'border-radius',
|
|
297
|
+
'border-left',
|
|
298
|
+
'border-top',
|
|
299
|
+
'border-right',
|
|
300
|
+
'border-bottom',
|
|
301
|
+
'float',
|
|
302
|
+
'clear',
|
|
303
|
+
'position',
|
|
304
|
+
'overflow',
|
|
305
|
+
'content',
|
|
306
|
+
'display',
|
|
307
|
+
'flex',
|
|
308
|
+
'flex-direction',
|
|
309
|
+
'flex-wrap',
|
|
310
|
+
'flex-flow',
|
|
311
|
+
'order',
|
|
312
|
+
'justify-content',
|
|
313
|
+
'align-items',
|
|
314
|
+
'align-self',
|
|
315
|
+
'align-content',
|
|
316
|
+
'flex-grow',
|
|
317
|
+
'flex-shrink',
|
|
318
|
+
'flex-basis',
|
|
319
|
+
'visibility',
|
|
320
|
+
'box-sizing',
|
|
321
|
+
'box-shadow',
|
|
322
|
+
'left',
|
|
323
|
+
'top',
|
|
324
|
+
'right',
|
|
325
|
+
'bottom',
|
|
326
|
+
'vertical-align',
|
|
327
|
+
'z-index',
|
|
328
|
+
'transform',
|
|
329
|
+
'transition',
|
|
330
|
+
'animation',
|
|
331
|
+
'animation-delay',
|
|
332
|
+
'animation-direction',
|
|
333
|
+
'animation-duration',
|
|
334
|
+
'animation-fill-mode',
|
|
335
|
+
'animation-iteration-count',
|
|
336
|
+
'animation-name',
|
|
337
|
+
'animation-play-state',
|
|
338
|
+
'animation-timing-function',
|
|
339
|
+
'opacity',
|
|
340
|
+
'cursor',
|
|
341
|
+
],
|
|
342
|
+
],
|
|
343
|
+
'plugin/no-unsupported-browser-features': [
|
|
344
|
+
true,
|
|
345
|
+
{
|
|
346
|
+
browsers: [
|
|
347
|
+
'defaults',
|
|
348
|
+
'not op_mini all',
|
|
349
|
+
'not kaios >= 0',
|
|
350
|
+
'not and_uc >= 0',
|
|
351
|
+
'not and_qq >= 0',
|
|
352
|
+
],
|
|
353
|
+
ignore: [
|
|
354
|
+
'css-autofill',
|
|
355
|
+
'css-nesting',
|
|
356
|
+
'css-paged-media',
|
|
357
|
+
'css-variables',
|
|
358
|
+
'prefers-color-scheme',
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
'prettier/prettier': true,
|
|
363
|
+
'property-disallowed-list': ['/^margin-/', '/^padding-/'],
|
|
364
|
+
'property-no-unknown': [
|
|
365
|
+
true,
|
|
366
|
+
{
|
|
367
|
+
ignoreProperties: [
|
|
368
|
+
'letter-spacing-range',
|
|
369
|
+
'aspect-ratio',
|
|
370
|
+
'font-range',
|
|
371
|
+
'line-height-range',
|
|
372
|
+
],
|
|
373
|
+
},
|
|
374
|
+
],
|
|
375
|
+
'rule-empty-line-before': [
|
|
376
|
+
'always',
|
|
377
|
+
{
|
|
378
|
+
except: ['first-nested', 'inside-block'],
|
|
379
|
+
ignore: ['after-comment'],
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
// block[-part][__element]*[_modifier]*[--modifier]*, $(token) в частях.
|
|
383
|
+
'selector-class-pattern': [
|
|
384
|
+
'^[a-z][a-z0-9]*(-[a-z0-9]+)*(?:__[a-zA-Z0-9$()-]+)*(?:_[a-zA-Z0-9$()-]+)*(?:--[a-zA-Z0-9$()-]+)*$',
|
|
385
|
+
{
|
|
386
|
+
severity: 'warning',
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
// kebab-case, плюс #__next — корень Next.js.
|
|
390
|
+
'selector-id-pattern': [
|
|
391
|
+
'^(?:__next|[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$',
|
|
392
|
+
{
|
|
393
|
+
message: (selector) => `Expected id selector "${selector}" to be kebab-case`,
|
|
394
|
+
},
|
|
395
|
+
],
|
|
396
|
+
// Вложенный селектор: & / ^& / && / &_mod&_mod, дальше БЭМ, псевдо, атрибут или комбинатор.
|
|
397
|
+
// splitList — каждая часть списка селекторов отдельно.
|
|
398
|
+
'selector-nested-pattern': [
|
|
399
|
+
nestedSelectorPattern,
|
|
400
|
+
{
|
|
401
|
+
splitList: true,
|
|
402
|
+
},
|
|
403
|
+
],
|
|
404
|
+
// css-tree не парсит postcss-nested ^&. Проверка в itcase/selector-no-invalid.
|
|
405
|
+
'selector-no-invalid': null,
|
|
406
|
+
'selector-type-no-unknown': null,
|
|
407
|
+
'shorthand-property-no-redundant-values': null,
|
|
408
|
+
},
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
export { index as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/lint",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.138",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets ",
|
|
6
6
|
"engines": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"registry": "https://registry.npmjs.org/"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@babel/eslint-parser": "^8.
|
|
47
|
+
"@babel/eslint-parser": "^8.1.2",
|
|
48
48
|
"@babel/eslint-plugin": "^8.1.0",
|
|
49
49
|
"@eslint/compat": "^2.1.1",
|
|
50
50
|
"@eslint/js": "^10.0.1",
|
|
@@ -53,45 +53,45 @@
|
|
|
53
53
|
"@html-eslint/eslint-plugin": "^0.68.0",
|
|
54
54
|
"@html-eslint/parser": "^0.68.0",
|
|
55
55
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
57
|
-
"@typescript-eslint/parser": "^8.
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^8.73.0",
|
|
57
|
+
"@typescript-eslint/parser": "^8.73.0",
|
|
58
58
|
"eslint": "9.39.2",
|
|
59
59
|
"eslint-config-prettier": "^10.1.8",
|
|
60
60
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
61
61
|
"eslint-plugin-html": "^8.2.1",
|
|
62
62
|
"eslint-plugin-import": "^2.32.0",
|
|
63
63
|
"eslint-plugin-json": "^5.0.0",
|
|
64
|
-
"eslint-plugin-mobx": "^0.2.
|
|
64
|
+
"eslint-plugin-mobx": "^0.2.2",
|
|
65
65
|
"eslint-plugin-n": "^18.5.0",
|
|
66
66
|
"eslint-plugin-node": "^11.1.0",
|
|
67
|
-
"eslint-plugin-perfectionist": "^5.
|
|
67
|
+
"eslint-plugin-perfectionist": "^5.14.0",
|
|
68
68
|
"eslint-plugin-prettier": "^5.5.7",
|
|
69
69
|
"eslint-plugin-promise": "^7.3.0",
|
|
70
70
|
"eslint-plugin-react": "^7.37.5",
|
|
71
71
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
72
72
|
"eslint-plugin-react-native": "^5.0.0",
|
|
73
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
73
|
+
"eslint-plugin-react-refresh": "^0.5.8",
|
|
74
74
|
"eslint-plugin-storybook": "^10.6.7",
|
|
75
75
|
"globals": "^17.14.0",
|
|
76
|
-
"prettier": "^3.10.
|
|
76
|
+
"prettier": "^3.10.1",
|
|
77
77
|
"stylelint": "^18.0.0",
|
|
78
78
|
"stylelint-config-standard": "^41.0.0",
|
|
79
79
|
"stylelint-no-unsupported-browser-features": "^8.1.2",
|
|
80
80
|
"stylelint-order": "^8.1.3",
|
|
81
81
|
"stylelint-prettier": "^5.1.0",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.73.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@itcase/config": "^1.7.33",
|
|
86
86
|
"@rollup/plugin-typescript": "^12.3.1",
|
|
87
87
|
"@types/node": "^26.6.6",
|
|
88
88
|
"@types/react": "^19.3.0",
|
|
89
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
89
|
+
"@typescript-eslint/rule-tester": "^8.73.0",
|
|
90
90
|
"del-cli": "^8.0.1",
|
|
91
91
|
"husky": "^9.1.7",
|
|
92
|
-
"lint-staged": "^17.6.
|
|
92
|
+
"lint-staged": "^17.6.1",
|
|
93
93
|
"react": "^19.3.1",
|
|
94
|
-
"rollup": "4.68.
|
|
94
|
+
"rollup": "4.68.5",
|
|
95
95
|
"storybook": "^10.6.7",
|
|
96
96
|
"tsx": "^4.23.15",
|
|
97
97
|
"typescript": "^6.0.3"
|
package/dist/stylelint/index2.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import stylelint from 'stylelint';
|
|
4
|
-
import config from './index3.js';
|
|
5
|
-
|
|
6
|
-
// `prettier/prettier` грузит `prettier.config.js`, а тот импортирует `dist`.
|
|
7
|
-
// В CI сборки ещё нет. Эти тесты проверяют другие правила.
|
|
8
|
-
const testConfig = {
|
|
9
|
-
...config,
|
|
10
|
-
rules: {
|
|
11
|
-
...config.rules,
|
|
12
|
-
'prettier/prettier': null,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
const nestedFormsCss = `
|
|
16
|
-
.form {
|
|
17
|
-
&__group {
|
|
18
|
-
&_hidden {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
&_type_row&_hidden {
|
|
22
|
-
display: none;
|
|
23
|
-
}
|
|
24
|
-
&_column {
|
|
25
|
-
@each $count in 2, 3 {
|
|
26
|
-
&_$(count) {
|
|
27
|
-
^^&-items {
|
|
28
|
-
display: grid;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
&-wrapper {
|
|
34
|
-
^&-message {
|
|
35
|
-
&_type_error {
|
|
36
|
-
display: block;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.form-field {
|
|
44
|
-
&-code {
|
|
45
|
-
&^&_type_classic {
|
|
46
|
-
^^&__label {
|
|
47
|
-
display: block;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
&^&_size {
|
|
51
|
-
@each $size in m, s {
|
|
52
|
-
&_$(size) {
|
|
53
|
-
gap: var(--form-filed-code-size-$(size)-gap);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
async function warningsFor(code, rule) {
|
|
61
|
-
const result = await stylelint.lint({
|
|
62
|
-
config: testConfig,
|
|
63
|
-
code,
|
|
64
|
-
codeFilename: 'fixture.css',
|
|
65
|
-
});
|
|
66
|
-
return result.results[0].warnings
|
|
67
|
-
.filter((warning) => warning.rule === rule)
|
|
68
|
-
.map((warning) => warning.text);
|
|
69
|
-
}
|
|
70
|
-
function mentions(warnings, text) {
|
|
71
|
-
return warnings.some((warning) => warning.includes(text));
|
|
72
|
-
}
|
|
73
|
-
describe('stylelint config', () => {
|
|
74
|
-
it('allows form custom properties with _ and $(token)', async () => {
|
|
75
|
-
const warnings = await warningsFor(`
|
|
76
|
-
.block {
|
|
77
|
-
--form-field_type_classic-padding: 0;
|
|
78
|
-
--form-filed-code-size-$(size)-gap: 0;
|
|
79
|
-
}
|
|
80
|
-
`, 'custom-property-pattern');
|
|
81
|
-
assert.equal(warnings.length, 0);
|
|
82
|
-
});
|
|
83
|
-
it('rejects a custom property that starts with a capital letter', async () => {
|
|
84
|
-
const warnings = await warningsFor(`
|
|
85
|
-
.block {
|
|
86
|
-
--Padding: 0;
|
|
87
|
-
}
|
|
88
|
-
`, 'custom-property-pattern');
|
|
89
|
-
assert.equal(mentions(warnings, 'Padding'), true);
|
|
90
|
-
});
|
|
91
|
-
it('allows BEM classes used by forms', async () => {
|
|
92
|
-
const warnings = await warningsFor(`
|
|
93
|
-
.form__group_type_row {
|
|
94
|
-
display: block;
|
|
95
|
-
}
|
|
96
|
-
`, 'selector-class-pattern');
|
|
97
|
-
assert.equal(warnings.length, 0);
|
|
98
|
-
});
|
|
99
|
-
it('rejects a class that starts with a capital letter', async () => {
|
|
100
|
-
const warnings = await warningsFor(`
|
|
101
|
-
.Form {
|
|
102
|
-
display: block;
|
|
103
|
-
}
|
|
104
|
-
`, 'selector-class-pattern');
|
|
105
|
-
assert.equal(mentions(warnings, 'Form'), true);
|
|
106
|
-
});
|
|
107
|
-
it('allows postcss-nested selectors from forms css', async () => {
|
|
108
|
-
const warnings = await warningsFor(nestedFormsCss, 'selector-nested-pattern');
|
|
109
|
-
assert.equal(warnings.length, 0);
|
|
110
|
-
});
|
|
111
|
-
it('rejects a nested selector outside the pattern', async () => {
|
|
112
|
-
const warnings = await warningsFor(`
|
|
113
|
-
.form {
|
|
114
|
-
NOT_A_SELECTOR {
|
|
115
|
-
display: block;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
`, 'selector-nested-pattern');
|
|
119
|
-
assert.equal(mentions(warnings, 'NOT_A_SELECTOR'), true);
|
|
120
|
-
});
|
|
121
|
-
it('does not flag ^& and still flags an invalid pseudo', async () => {
|
|
122
|
-
const code = `
|
|
123
|
-
.form {
|
|
124
|
-
^&-message {
|
|
125
|
-
display: block;
|
|
126
|
-
}
|
|
127
|
-
&:dir(sideways) {
|
|
128
|
-
display: block;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
`;
|
|
132
|
-
const invalid = await warningsFor(code, 'selector-no-invalid');
|
|
133
|
-
const itcaseInvalid = await warningsFor(code, 'itcase/selector-no-invalid');
|
|
134
|
-
assert.equal(mentions(invalid, '^&'), false);
|
|
135
|
-
assert.equal(mentions(itcaseInvalid, '^&'), false);
|
|
136
|
-
assert.equal(mentions(invalid, ':dir(sideways)'), true);
|
|
137
|
-
});
|
|
138
|
-
it('allows a camelCase keyframe and rejects kebab-case', async () => {
|
|
139
|
-
const allowed = await warningsFor(`
|
|
140
|
-
@keyframes fadeIn {
|
|
141
|
-
from { opacity: 0; }
|
|
142
|
-
to { opacity: 1; }
|
|
143
|
-
}
|
|
144
|
-
`, 'keyframes-name-pattern');
|
|
145
|
-
const rejected = await warningsFor(`
|
|
146
|
-
@keyframes fade-in {
|
|
147
|
-
from { opacity: 0; }
|
|
148
|
-
to { opacity: 1; }
|
|
149
|
-
}
|
|
150
|
-
`, 'keyframes-name-pattern');
|
|
151
|
-
assert.equal(allowed.length, 0);
|
|
152
|
-
assert.equal(mentions(rejected, 'camelCase'), true);
|
|
153
|
-
});
|
|
154
|
-
it('allows @each and rejects an unknown at-rule', async () => {
|
|
155
|
-
const allowed = await warningsFor(`
|
|
156
|
-
@each $count in 2, 3 {
|
|
157
|
-
.item { display: block; }
|
|
158
|
-
}
|
|
159
|
-
`, 'at-rule-no-unknown');
|
|
160
|
-
const rejected = await warningsFor(`
|
|
161
|
-
@not-a-rule {
|
|
162
|
-
.item { display: block; }
|
|
163
|
-
}
|
|
164
|
-
`, 'at-rule-no-unknown');
|
|
165
|
-
assert.equal(allowed.length, 0);
|
|
166
|
-
assert.equal(mentions(rejected, 'not-a-rule'), true);
|
|
167
|
-
});
|
|
168
|
-
it('allows $() and fluid() and rejects an unknown function', async () => {
|
|
169
|
-
const allowed = await warningsFor(`
|
|
170
|
-
.item {
|
|
171
|
-
width: $(count);
|
|
172
|
-
font-size: fluid(16, 24);
|
|
173
|
-
}
|
|
174
|
-
`, 'function-no-unknown');
|
|
175
|
-
const rejected = await warningsFor(`
|
|
176
|
-
.item {
|
|
177
|
-
width: nope(1);
|
|
178
|
-
}
|
|
179
|
-
`, 'function-no-unknown');
|
|
180
|
-
assert.equal(allowed.length, 0);
|
|
181
|
-
assert.equal(mentions(rejected, 'nope'), true);
|
|
182
|
-
});
|
|
183
|
-
});
|
package/dist/stylelint/index3.js
DELETED
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
import stylelint from 'stylelint';
|
|
2
|
-
|
|
3
|
-
// postcss-nested: ^& / ^^& / &^&. Не [attr^="..."] — там после ^ стоит =, не &.
|
|
4
|
-
const postcssNestedParentSelector = /(?:^|[\s>~+,])\^+&|&\^+&/;
|
|
5
|
-
// Кусок после &: БЭМ, псевдо, атрибут, класс или тег. $(token) из postcss-each.
|
|
6
|
-
const nestedSelectorChunk = '(?:(?:__|--|_|-)[\\w$().-]*|::[\\w-]+|:[\\w-]+(?:\\([^)]*\\))?|\\[[^\\]]+\\]|\\.[\\w$().-]+|[A-Za-z0-9]+)?';
|
|
7
|
-
const nestedSelectorPattern = [
|
|
8
|
-
'^(?:[a-z]+&+|\\.[a-z][\\w-]*&+|>\\s+\\^+&+|&+\\^+&+|\\^+&+|&+)',
|
|
9
|
-
nestedSelectorChunk,
|
|
10
|
-
'(?:\\s*[>~+]\\s+\\S+|\\s+\\S+|\\.[\\w$().-]+|::[\\w-]+|:[\\w-]+(?:\\([^)]*\\))?|\\[[^\\]]+\\]|',
|
|
11
|
-
'&+',
|
|
12
|
-
nestedSelectorChunk,
|
|
13
|
-
')*$',
|
|
14
|
-
].join('');
|
|
15
|
-
function readRuleSelector(ruleNode) {
|
|
16
|
-
const raw = ruleNode.raws.selector;
|
|
17
|
-
if (typeof raw === 'string' && raw)
|
|
18
|
-
return raw;
|
|
19
|
-
if (raw &&
|
|
20
|
-
typeof raw === 'object' &&
|
|
21
|
-
'raw' in raw &&
|
|
22
|
-
typeof raw.raw === 'string') {
|
|
23
|
-
return raw.raw;
|
|
24
|
-
}
|
|
25
|
-
return ruleNode.selector;
|
|
26
|
-
}
|
|
27
|
-
function collectParked(walkRules) {
|
|
28
|
-
const parked = [];
|
|
29
|
-
walkRules((ruleNode) => {
|
|
30
|
-
if (!postcssNestedParentSelector.test(readRuleSelector(ruleNode)))
|
|
31
|
-
return;
|
|
32
|
-
parked.push({
|
|
33
|
-
next: ruleNode.next(),
|
|
34
|
-
node: ruleNode,
|
|
35
|
-
parent: ruleNode.parent,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
return parked;
|
|
39
|
-
}
|
|
40
|
-
// css-tree в selector-no-invalid не парсит ^&. Снимаем такие правила на время проверки.
|
|
41
|
-
const selectorNoInvalidRuleName = 'itcase/selector-no-invalid';
|
|
42
|
-
const selectorNoInvalidRule = Object.assign((primary, _secondaryOptions, context) => {
|
|
43
|
-
return async (root, result) => {
|
|
44
|
-
if (primary !== true)
|
|
45
|
-
return;
|
|
46
|
-
const parked = collectParked((callback) => {
|
|
47
|
-
root.walkRules(callback);
|
|
48
|
-
});
|
|
49
|
-
for (let index = parked.length - 1; index >= 0; index -= 1) {
|
|
50
|
-
parked[index].node.remove();
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const coreRule = await stylelint.rules['selector-no-invalid'];
|
|
54
|
-
await coreRule(true, {}, context)(root, result);
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
for (const item of parked) {
|
|
58
|
-
if (!item.parent)
|
|
59
|
-
continue;
|
|
60
|
-
if (item.next && item.next.parent === item.parent) {
|
|
61
|
-
item.parent.insertBefore(item.next, item.node);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
item.parent.append(item.node);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}, {
|
|
70
|
-
messages: {},
|
|
71
|
-
ruleName: selectorNoInvalidRuleName,
|
|
72
|
-
});
|
|
73
|
-
// eslint-disable-next-line import/no-default-export
|
|
74
|
-
var config = {
|
|
75
|
-
extends: ['stylelint-config-standard'],
|
|
76
|
-
ignoreFiles: [
|
|
77
|
-
'**/__*.css',
|
|
78
|
-
'**/import.css',
|
|
79
|
-
'**/vendor/**/*.css',
|
|
80
|
-
'**/vendor/*.css',
|
|
81
|
-
'__*.css',
|
|
82
|
-
'**/*.ts',
|
|
83
|
-
'**/*.tsx',
|
|
84
|
-
'**/*.js',
|
|
85
|
-
'**/*.jsx',
|
|
86
|
-
'**/*.mjs',
|
|
87
|
-
'**/*.md',
|
|
88
|
-
'ios/**/*',
|
|
89
|
-
'android/**/*',
|
|
90
|
-
],
|
|
91
|
-
plugins: [
|
|
92
|
-
'stylelint-prettier',
|
|
93
|
-
'stylelint-order',
|
|
94
|
-
'stylelint-no-unsupported-browser-features',
|
|
95
|
-
stylelint.createPlugin(selectorNoInvalidRuleName, selectorNoInvalidRule),
|
|
96
|
-
],
|
|
97
|
-
rules: {
|
|
98
|
-
'max-nesting-depth': 20,
|
|
99
|
-
'alpha-value-notation': [
|
|
100
|
-
'number',
|
|
101
|
-
{
|
|
102
|
-
exceptProperties: ['opacity'],
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
'at-rule-empty-line-before': [
|
|
106
|
-
'always',
|
|
107
|
-
{
|
|
108
|
-
except: ['inside-block'],
|
|
109
|
-
ignore: [
|
|
110
|
-
'after-comment',
|
|
111
|
-
'first-nested',
|
|
112
|
-
'blockless-after-same-name-blockless',
|
|
113
|
-
'blockless-after-blockless',
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
'at-rule-no-unknown': [
|
|
118
|
-
true,
|
|
119
|
-
{
|
|
120
|
-
ignoreAtRules: [
|
|
121
|
-
'import-glob',
|
|
122
|
-
'for',
|
|
123
|
-
'each',
|
|
124
|
-
'mixin',
|
|
125
|
-
'extend',
|
|
126
|
-
'define-mixin',
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
],
|
|
130
|
-
'block-no-empty': null,
|
|
131
|
-
'color-function-notation': 'legacy',
|
|
132
|
-
'color-no-hex': true,
|
|
133
|
-
'comment-empty-line-before': [
|
|
134
|
-
'always',
|
|
135
|
-
{
|
|
136
|
-
except: ['first-nested'],
|
|
137
|
-
ignore: ['after-comment'],
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
'custom-property-empty-line-before': null,
|
|
141
|
-
// kebab-case и _, плюс $(token) из postcss-each.
|
|
142
|
-
'custom-property-pattern': '^(?:[a-z]|\\$\\([A-Za-z0-9_-]+\\))(?:[a-z0-9_-]|\\$\\([A-Za-z0-9_-]+\\))*$',
|
|
143
|
-
'declaration-empty-line-before': 'never',
|
|
144
|
-
'declaration-property-value-no-unknown': [
|
|
145
|
-
true,
|
|
146
|
-
{
|
|
147
|
-
ignoreProperties: {
|
|
148
|
-
top: '/.+/',
|
|
149
|
-
right: '/.+/',
|
|
150
|
-
bottom: '/.+/',
|
|
151
|
-
left: '/.+/',
|
|
152
|
-
border: '/.+/',
|
|
153
|
-
margin: '/.+/',
|
|
154
|
-
padding: '/.+/',
|
|
155
|
-
gap: '/.+/',
|
|
156
|
-
'/-gap$/': '/.+/',
|
|
157
|
-
'/^border-/': '/.+/',
|
|
158
|
-
'/^margin-/': '/.+/',
|
|
159
|
-
'/^padding-/': '/.+/',
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
'function-no-unknown': [true, { ignoreFunctions: ['$', 'fluid'] }],
|
|
164
|
-
'function-url-quotes': 'always',
|
|
165
|
-
'hue-degree-notation': 'number',
|
|
166
|
-
'import-notation': 'string',
|
|
167
|
-
'itcase/selector-no-invalid': true,
|
|
168
|
-
'keyframes-name-pattern': [
|
|
169
|
-
'^([a-z]+)([A-Z]?[a-z]+)+$',
|
|
170
|
-
{ message: 'Expected keyframe name to be camelCase' },
|
|
171
|
-
],
|
|
172
|
-
'no-descending-specificity': null,
|
|
173
|
-
'order/order': [
|
|
174
|
-
[
|
|
175
|
-
'declarations',
|
|
176
|
-
{
|
|
177
|
-
type: 'at-rule',
|
|
178
|
-
name: 'extend',
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
type: 'at-rule',
|
|
182
|
-
name: 'mixin',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
type: 'at-rule',
|
|
186
|
-
name: 'media',
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
type: 'rule',
|
|
190
|
-
selector: '^&::(before|after)',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
type: 'rule',
|
|
194
|
-
selector: '^&:\\w',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
type: 'rule',
|
|
198
|
-
selector: '^&_',
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
type: 'rule',
|
|
202
|
-
selector: '^.',
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
{
|
|
206
|
-
unspecified: 'bottom',
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
'order/properties-order': [
|
|
210
|
-
[
|
|
211
|
-
'width',
|
|
212
|
-
'height',
|
|
213
|
-
'min-width',
|
|
214
|
-
'min-height',
|
|
215
|
-
'max-width',
|
|
216
|
-
'max-height',
|
|
217
|
-
'aspect-ratio',
|
|
218
|
-
'font',
|
|
219
|
-
'font-size',
|
|
220
|
-
'font-range',
|
|
221
|
-
'font-weight',
|
|
222
|
-
'color',
|
|
223
|
-
'text-shadow',
|
|
224
|
-
'text-decoration',
|
|
225
|
-
'text-transform',
|
|
226
|
-
'text-align',
|
|
227
|
-
'text-rendering',
|
|
228
|
-
'white-space',
|
|
229
|
-
'line-height',
|
|
230
|
-
'line-height-range',
|
|
231
|
-
'letter-spacing',
|
|
232
|
-
'background',
|
|
233
|
-
'background-position',
|
|
234
|
-
'background-repeat',
|
|
235
|
-
'background-size',
|
|
236
|
-
'padding',
|
|
237
|
-
'margin',
|
|
238
|
-
'border',
|
|
239
|
-
'border-width',
|
|
240
|
-
'border-color',
|
|
241
|
-
'border-style',
|
|
242
|
-
'border-radius',
|
|
243
|
-
'border-left',
|
|
244
|
-
'border-top',
|
|
245
|
-
'border-right',
|
|
246
|
-
'border-bottom',
|
|
247
|
-
'float',
|
|
248
|
-
'clear',
|
|
249
|
-
'position',
|
|
250
|
-
'overflow',
|
|
251
|
-
'content',
|
|
252
|
-
'display',
|
|
253
|
-
'flex',
|
|
254
|
-
'flex-direction',
|
|
255
|
-
'flex-wrap',
|
|
256
|
-
'flex-flow',
|
|
257
|
-
'order',
|
|
258
|
-
'justify-content',
|
|
259
|
-
'align-items',
|
|
260
|
-
'align-self',
|
|
261
|
-
'align-content',
|
|
262
|
-
'flex-grow',
|
|
263
|
-
'flex-shrink',
|
|
264
|
-
'flex-basis',
|
|
265
|
-
'visibility',
|
|
266
|
-
'box-sizing',
|
|
267
|
-
'box-shadow',
|
|
268
|
-
'left',
|
|
269
|
-
'top',
|
|
270
|
-
'right',
|
|
271
|
-
'bottom',
|
|
272
|
-
'vertical-align',
|
|
273
|
-
'z-index',
|
|
274
|
-
'transform',
|
|
275
|
-
'transition',
|
|
276
|
-
'animation',
|
|
277
|
-
'animation-delay',
|
|
278
|
-
'animation-direction',
|
|
279
|
-
'animation-duration',
|
|
280
|
-
'animation-fill-mode',
|
|
281
|
-
'animation-iteration-count',
|
|
282
|
-
'animation-name',
|
|
283
|
-
'animation-play-state',
|
|
284
|
-
'animation-timing-function',
|
|
285
|
-
'opacity',
|
|
286
|
-
'cursor',
|
|
287
|
-
],
|
|
288
|
-
],
|
|
289
|
-
'plugin/no-unsupported-browser-features': [
|
|
290
|
-
true,
|
|
291
|
-
{
|
|
292
|
-
browsers: [
|
|
293
|
-
'defaults',
|
|
294
|
-
'not op_mini all',
|
|
295
|
-
'not kaios >= 0',
|
|
296
|
-
'not and_uc >= 0',
|
|
297
|
-
'not and_qq >= 0',
|
|
298
|
-
],
|
|
299
|
-
ignore: [
|
|
300
|
-
'css-autofill',
|
|
301
|
-
'css-nesting',
|
|
302
|
-
'css-variables',
|
|
303
|
-
'prefers-color-scheme',
|
|
304
|
-
],
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
'prettier/prettier': true,
|
|
308
|
-
'property-disallowed-list': ['/^margin-/', '/^padding-/'],
|
|
309
|
-
'property-no-unknown': [
|
|
310
|
-
true,
|
|
311
|
-
{
|
|
312
|
-
ignoreProperties: [
|
|
313
|
-
'letter-spacing-range',
|
|
314
|
-
'aspect-ratio',
|
|
315
|
-
'font-range',
|
|
316
|
-
'line-height-range',
|
|
317
|
-
],
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
'rule-empty-line-before': [
|
|
321
|
-
'always',
|
|
322
|
-
{
|
|
323
|
-
except: ['first-nested', 'inside-block'],
|
|
324
|
-
ignore: ['after-comment'],
|
|
325
|
-
},
|
|
326
|
-
],
|
|
327
|
-
// block[-part][__element]*[_modifier]*[--modifier]*, $(token) в частях.
|
|
328
|
-
'selector-class-pattern': [
|
|
329
|
-
'^[a-z][a-z0-9]*(-[a-z0-9]+)*(?:__[a-zA-Z0-9$()-]+)*(?:_[a-zA-Z0-9$()-]+)*(?:--[a-zA-Z0-9$()-]+)*$',
|
|
330
|
-
{
|
|
331
|
-
severity: 'warning',
|
|
332
|
-
},
|
|
333
|
-
],
|
|
334
|
-
// Вложенный селектор: & / ^& / && / &_mod&_mod, дальше БЭМ, псевдо, атрибут или комбинатор.
|
|
335
|
-
// splitList — каждая часть списка селекторов отдельно.
|
|
336
|
-
'selector-nested-pattern': [
|
|
337
|
-
nestedSelectorPattern,
|
|
338
|
-
{
|
|
339
|
-
splitList: true,
|
|
340
|
-
},
|
|
341
|
-
],
|
|
342
|
-
// css-tree не парсит postcss-nested ^&. Проверка в itcase/selector-no-invalid.
|
|
343
|
-
'selector-no-invalid': null,
|
|
344
|
-
'selector-type-no-unknown': null,
|
|
345
|
-
'shorthand-property-no-redundant-values': null,
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
export { config as default };
|