@xiaohe01/stylelint-config 2.2.0 → 2.3.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/dist/index.cjs +85 -74
- package/dist/index.d.cts +7 -9
- package/dist/index.d.mts +7 -9
- package/dist/index.d.ts +7 -9
- package/dist/index.mjs +85 -74
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,9 @@ const GLOB_ALL = [
|
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
function core(options = {}) {
|
|
17
|
+
const {
|
|
18
|
+
vue = false
|
|
19
|
+
} = options;
|
|
17
20
|
return [
|
|
18
21
|
{
|
|
19
22
|
name: "xiaohe/core/rules",
|
|
@@ -108,6 +111,28 @@ function core(options = {}) {
|
|
|
108
111
|
]
|
|
109
112
|
}
|
|
110
113
|
],
|
|
114
|
+
...vue ? {
|
|
115
|
+
"selector-pseudo-class-no-unknown": [
|
|
116
|
+
true,
|
|
117
|
+
{
|
|
118
|
+
ignorePseudoClasses: [
|
|
119
|
+
"deep",
|
|
120
|
+
"global",
|
|
121
|
+
"slotted"
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"selector-pseudo-element-no-unknown": [
|
|
126
|
+
true,
|
|
127
|
+
{
|
|
128
|
+
ignorePseudoElements: [
|
|
129
|
+
"v-deep",
|
|
130
|
+
"v-global",
|
|
131
|
+
"v-slotted"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
} : {},
|
|
111
136
|
...options.overrides
|
|
112
137
|
}
|
|
113
138
|
}
|
|
@@ -128,11 +153,6 @@ function css(options = {}) {
|
|
|
128
153
|
|
|
129
154
|
function html(options = {}) {
|
|
130
155
|
return [
|
|
131
|
-
{
|
|
132
|
-
name: "xiaohe/html/setup",
|
|
133
|
-
files: GLOB_HTML,
|
|
134
|
-
customSyntax: "postcss-html"
|
|
135
|
-
},
|
|
136
156
|
{
|
|
137
157
|
name: "xiaohe/html/rules",
|
|
138
158
|
files: GLOB_HTML,
|
|
@@ -144,18 +164,16 @@ function html(options = {}) {
|
|
|
144
164
|
}
|
|
145
165
|
|
|
146
166
|
function scss(options = {}) {
|
|
167
|
+
const {
|
|
168
|
+
vue = false
|
|
169
|
+
} = options;
|
|
147
170
|
return [
|
|
148
|
-
{
|
|
149
|
-
name: "xiaohe/scss/setup",
|
|
150
|
-
files: GLOB_SCSS,
|
|
151
|
-
customSyntax: "postcss-scss",
|
|
152
|
-
plugins: [
|
|
153
|
-
"stylelint-scss"
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
171
|
{
|
|
157
172
|
name: "xiaohe/scss/rules",
|
|
158
|
-
files:
|
|
173
|
+
files: [
|
|
174
|
+
...GLOB_SCSS,
|
|
175
|
+
...vue ? GLOB_VUE : []
|
|
176
|
+
],
|
|
159
177
|
rules: {
|
|
160
178
|
"annotation-no-unknown": null,
|
|
161
179
|
"at-rule-no-unknown": null,
|
|
@@ -192,59 +210,51 @@ function scss(options = {}) {
|
|
|
192
210
|
];
|
|
193
211
|
}
|
|
194
212
|
|
|
195
|
-
function
|
|
213
|
+
function setup(options = {}) {
|
|
196
214
|
const {
|
|
197
|
-
scss = false
|
|
215
|
+
scss = false,
|
|
216
|
+
html = false,
|
|
217
|
+
vue = false
|
|
198
218
|
} = options;
|
|
199
|
-
|
|
200
|
-
|
|
219
|
+
const overrides = [];
|
|
220
|
+
if (html) {
|
|
221
|
+
overrides.push({
|
|
222
|
+
name: "xiaohe/html/setup",
|
|
223
|
+
files: GLOB_HTML,
|
|
224
|
+
customSyntax: "postcss-html"
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (vue) {
|
|
228
|
+
overrides.push({
|
|
201
229
|
name: "xiaohe/vue/setup",
|
|
202
230
|
files: GLOB_VUE,
|
|
203
|
-
customSyntax: "postcss-html"
|
|
204
|
-
|
|
231
|
+
customSyntax: "postcss-html",
|
|
232
|
+
plugins: [
|
|
233
|
+
...scss ? [
|
|
234
|
+
"stylelint-scss"
|
|
235
|
+
] : []
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (scss) {
|
|
240
|
+
overrides.push({
|
|
241
|
+
name: "xiaohe/scss/setup",
|
|
242
|
+
files: GLOB_SCSS,
|
|
243
|
+
customSyntax: "postcss-scss",
|
|
244
|
+
plugins: [
|
|
245
|
+
"stylelint-scss"
|
|
246
|
+
]
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return overrides;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function vue(options = {}) {
|
|
253
|
+
return [
|
|
205
254
|
{
|
|
206
255
|
name: "xiaohe/vue/rules",
|
|
207
256
|
files: GLOB_VUE,
|
|
208
257
|
rules: {
|
|
209
|
-
"declaration-property-value-no-unknown": [
|
|
210
|
-
true,
|
|
211
|
-
{
|
|
212
|
-
ignoreProperties: {
|
|
213
|
-
"/.*/": "/v-bind\\(.+\\)/"
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
],
|
|
217
|
-
"function-no-unknown": [
|
|
218
|
-
true,
|
|
219
|
-
{
|
|
220
|
-
ignoreFunctions: [
|
|
221
|
-
"v-bind"
|
|
222
|
-
]
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
"selector-pseudo-class-no-unknown": [
|
|
226
|
-
true,
|
|
227
|
-
{
|
|
228
|
-
ignorePseudoClasses: [
|
|
229
|
-
"deep",
|
|
230
|
-
"global",
|
|
231
|
-
"slotted"
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
],
|
|
235
|
-
"selector-pseudo-element-no-unknown": [
|
|
236
|
-
true,
|
|
237
|
-
{
|
|
238
|
-
ignorePseudoElements: [
|
|
239
|
-
"v-deep",
|
|
240
|
-
"v-global",
|
|
241
|
-
"v-slotted"
|
|
242
|
-
]
|
|
243
|
-
}
|
|
244
|
-
],
|
|
245
|
-
...scss ? {
|
|
246
|
-
"function-no-unknown": null
|
|
247
|
-
} : {},
|
|
248
258
|
...options.overrides
|
|
249
259
|
}
|
|
250
260
|
}
|
|
@@ -272,20 +282,29 @@ function isPkgExists(pkg) {
|
|
|
272
282
|
|
|
273
283
|
function defineConfig(options = {}, ...userOverrides) {
|
|
274
284
|
const {
|
|
275
|
-
css: enableCss = true,
|
|
276
|
-
html: enableHtml = true,
|
|
277
285
|
scss: enableScss = isPkgExists(SCSS_PACKAGES),
|
|
286
|
+
html: enableHtml = true,
|
|
278
287
|
vue: enableVue = isPkgExists(VUE_PACKAGES)
|
|
279
288
|
} = options;
|
|
280
289
|
const overrides = [
|
|
290
|
+
...setup({
|
|
291
|
+
scss: !!enableScss,
|
|
292
|
+
html: !!enableHtml,
|
|
293
|
+
vue: !!enableVue
|
|
294
|
+
}),
|
|
281
295
|
...core({
|
|
282
|
-
overrides: getOverrides(options.core)
|
|
296
|
+
overrides: getOverrides(options.core),
|
|
297
|
+
vue: !!enableVue
|
|
298
|
+
}),
|
|
299
|
+
...css({
|
|
300
|
+
overrides: getOverrides(options.css)
|
|
283
301
|
})
|
|
284
302
|
];
|
|
285
|
-
if (
|
|
303
|
+
if (enableScss) {
|
|
286
304
|
overrides.push(
|
|
287
|
-
...
|
|
288
|
-
overrides: getOverrides(options.
|
|
305
|
+
...scss({
|
|
306
|
+
overrides: getOverrides(options.scss),
|
|
307
|
+
vue: !!enableVue
|
|
289
308
|
})
|
|
290
309
|
);
|
|
291
310
|
}
|
|
@@ -296,18 +315,10 @@ function defineConfig(options = {}, ...userOverrides) {
|
|
|
296
315
|
})
|
|
297
316
|
);
|
|
298
317
|
}
|
|
299
|
-
if (enableScss) {
|
|
300
|
-
overrides.push(
|
|
301
|
-
...scss({
|
|
302
|
-
overrides: getOverrides(options.scss)
|
|
303
|
-
})
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
318
|
if (enableVue) {
|
|
307
319
|
overrides.push(
|
|
308
320
|
...vue({
|
|
309
|
-
overrides: getOverrides(options.vue)
|
|
310
|
-
scss: !!enableScss
|
|
321
|
+
overrides: getOverrides(options.vue)
|
|
311
322
|
})
|
|
312
323
|
);
|
|
313
324
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -14,23 +14,21 @@ interface OptionsConfig {
|
|
|
14
14
|
*/
|
|
15
15
|
core?: OptionsOverrides;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* CSS rules.
|
|
18
|
+
*/
|
|
19
|
+
css?: OptionsOverrides;
|
|
20
|
+
/**
|
|
21
|
+
* Enable Scss support.
|
|
18
22
|
*
|
|
19
|
-
* @default
|
|
23
|
+
* @default auto-detect based on the dependencies
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
scss?: boolean | OptionsOverrides;
|
|
22
26
|
/**
|
|
23
27
|
* Enable HTML support.
|
|
24
28
|
*
|
|
25
29
|
* @default true
|
|
26
30
|
*/
|
|
27
31
|
html?: boolean | OptionsOverrides;
|
|
28
|
-
/**
|
|
29
|
-
* Enable Scss support.
|
|
30
|
-
*
|
|
31
|
-
* @default auto-detect based on the dependencies
|
|
32
|
-
*/
|
|
33
|
-
scss?: boolean | OptionsOverrides;
|
|
34
32
|
/**
|
|
35
33
|
* Enable Vue support.
|
|
36
34
|
*
|
package/dist/index.d.mts
CHANGED
|
@@ -14,23 +14,21 @@ interface OptionsConfig {
|
|
|
14
14
|
*/
|
|
15
15
|
core?: OptionsOverrides;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* CSS rules.
|
|
18
|
+
*/
|
|
19
|
+
css?: OptionsOverrides;
|
|
20
|
+
/**
|
|
21
|
+
* Enable Scss support.
|
|
18
22
|
*
|
|
19
|
-
* @default
|
|
23
|
+
* @default auto-detect based on the dependencies
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
scss?: boolean | OptionsOverrides;
|
|
22
26
|
/**
|
|
23
27
|
* Enable HTML support.
|
|
24
28
|
*
|
|
25
29
|
* @default true
|
|
26
30
|
*/
|
|
27
31
|
html?: boolean | OptionsOverrides;
|
|
28
|
-
/**
|
|
29
|
-
* Enable Scss support.
|
|
30
|
-
*
|
|
31
|
-
* @default auto-detect based on the dependencies
|
|
32
|
-
*/
|
|
33
|
-
scss?: boolean | OptionsOverrides;
|
|
34
32
|
/**
|
|
35
33
|
* Enable Vue support.
|
|
36
34
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -14,23 +14,21 @@ interface OptionsConfig {
|
|
|
14
14
|
*/
|
|
15
15
|
core?: OptionsOverrides;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* CSS rules.
|
|
18
|
+
*/
|
|
19
|
+
css?: OptionsOverrides;
|
|
20
|
+
/**
|
|
21
|
+
* Enable Scss support.
|
|
18
22
|
*
|
|
19
|
-
* @default
|
|
23
|
+
* @default auto-detect based on the dependencies
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
scss?: boolean | OptionsOverrides;
|
|
22
26
|
/**
|
|
23
27
|
* Enable HTML support.
|
|
24
28
|
*
|
|
25
29
|
* @default true
|
|
26
30
|
*/
|
|
27
31
|
html?: boolean | OptionsOverrides;
|
|
28
|
-
/**
|
|
29
|
-
* Enable Scss support.
|
|
30
|
-
*
|
|
31
|
-
* @default auto-detect based on the dependencies
|
|
32
|
-
*/
|
|
33
|
-
scss?: boolean | OptionsOverrides;
|
|
34
32
|
/**
|
|
35
33
|
* Enable Vue support.
|
|
36
34
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,9 @@ const GLOB_ALL = [
|
|
|
12
12
|
];
|
|
13
13
|
|
|
14
14
|
function core(options = {}) {
|
|
15
|
+
const {
|
|
16
|
+
vue = false
|
|
17
|
+
} = options;
|
|
15
18
|
return [
|
|
16
19
|
{
|
|
17
20
|
name: "xiaohe/core/rules",
|
|
@@ -106,6 +109,28 @@ function core(options = {}) {
|
|
|
106
109
|
]
|
|
107
110
|
}
|
|
108
111
|
],
|
|
112
|
+
...vue ? {
|
|
113
|
+
"selector-pseudo-class-no-unknown": [
|
|
114
|
+
true,
|
|
115
|
+
{
|
|
116
|
+
ignorePseudoClasses: [
|
|
117
|
+
"deep",
|
|
118
|
+
"global",
|
|
119
|
+
"slotted"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"selector-pseudo-element-no-unknown": [
|
|
124
|
+
true,
|
|
125
|
+
{
|
|
126
|
+
ignorePseudoElements: [
|
|
127
|
+
"v-deep",
|
|
128
|
+
"v-global",
|
|
129
|
+
"v-slotted"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
} : {},
|
|
109
134
|
...options.overrides
|
|
110
135
|
}
|
|
111
136
|
}
|
|
@@ -126,11 +151,6 @@ function css(options = {}) {
|
|
|
126
151
|
|
|
127
152
|
function html(options = {}) {
|
|
128
153
|
return [
|
|
129
|
-
{
|
|
130
|
-
name: "xiaohe/html/setup",
|
|
131
|
-
files: GLOB_HTML,
|
|
132
|
-
customSyntax: "postcss-html"
|
|
133
|
-
},
|
|
134
154
|
{
|
|
135
155
|
name: "xiaohe/html/rules",
|
|
136
156
|
files: GLOB_HTML,
|
|
@@ -142,18 +162,16 @@ function html(options = {}) {
|
|
|
142
162
|
}
|
|
143
163
|
|
|
144
164
|
function scss(options = {}) {
|
|
165
|
+
const {
|
|
166
|
+
vue = false
|
|
167
|
+
} = options;
|
|
145
168
|
return [
|
|
146
|
-
{
|
|
147
|
-
name: "xiaohe/scss/setup",
|
|
148
|
-
files: GLOB_SCSS,
|
|
149
|
-
customSyntax: "postcss-scss",
|
|
150
|
-
plugins: [
|
|
151
|
-
"stylelint-scss"
|
|
152
|
-
]
|
|
153
|
-
},
|
|
154
169
|
{
|
|
155
170
|
name: "xiaohe/scss/rules",
|
|
156
|
-
files:
|
|
171
|
+
files: [
|
|
172
|
+
...GLOB_SCSS,
|
|
173
|
+
...vue ? GLOB_VUE : []
|
|
174
|
+
],
|
|
157
175
|
rules: {
|
|
158
176
|
"annotation-no-unknown": null,
|
|
159
177
|
"at-rule-no-unknown": null,
|
|
@@ -190,59 +208,51 @@ function scss(options = {}) {
|
|
|
190
208
|
];
|
|
191
209
|
}
|
|
192
210
|
|
|
193
|
-
function
|
|
211
|
+
function setup(options = {}) {
|
|
194
212
|
const {
|
|
195
|
-
scss = false
|
|
213
|
+
scss = false,
|
|
214
|
+
html = false,
|
|
215
|
+
vue = false
|
|
196
216
|
} = options;
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
const overrides = [];
|
|
218
|
+
if (html) {
|
|
219
|
+
overrides.push({
|
|
220
|
+
name: "xiaohe/html/setup",
|
|
221
|
+
files: GLOB_HTML,
|
|
222
|
+
customSyntax: "postcss-html"
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
if (vue) {
|
|
226
|
+
overrides.push({
|
|
199
227
|
name: "xiaohe/vue/setup",
|
|
200
228
|
files: GLOB_VUE,
|
|
201
|
-
customSyntax: "postcss-html"
|
|
202
|
-
|
|
229
|
+
customSyntax: "postcss-html",
|
|
230
|
+
plugins: [
|
|
231
|
+
...scss ? [
|
|
232
|
+
"stylelint-scss"
|
|
233
|
+
] : []
|
|
234
|
+
]
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (scss) {
|
|
238
|
+
overrides.push({
|
|
239
|
+
name: "xiaohe/scss/setup",
|
|
240
|
+
files: GLOB_SCSS,
|
|
241
|
+
customSyntax: "postcss-scss",
|
|
242
|
+
plugins: [
|
|
243
|
+
"stylelint-scss"
|
|
244
|
+
]
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
return overrides;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function vue(options = {}) {
|
|
251
|
+
return [
|
|
203
252
|
{
|
|
204
253
|
name: "xiaohe/vue/rules",
|
|
205
254
|
files: GLOB_VUE,
|
|
206
255
|
rules: {
|
|
207
|
-
"declaration-property-value-no-unknown": [
|
|
208
|
-
true,
|
|
209
|
-
{
|
|
210
|
-
ignoreProperties: {
|
|
211
|
-
"/.*/": "/v-bind\\(.+\\)/"
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
],
|
|
215
|
-
"function-no-unknown": [
|
|
216
|
-
true,
|
|
217
|
-
{
|
|
218
|
-
ignoreFunctions: [
|
|
219
|
-
"v-bind"
|
|
220
|
-
]
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
"selector-pseudo-class-no-unknown": [
|
|
224
|
-
true,
|
|
225
|
-
{
|
|
226
|
-
ignorePseudoClasses: [
|
|
227
|
-
"deep",
|
|
228
|
-
"global",
|
|
229
|
-
"slotted"
|
|
230
|
-
]
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
"selector-pseudo-element-no-unknown": [
|
|
234
|
-
true,
|
|
235
|
-
{
|
|
236
|
-
ignorePseudoElements: [
|
|
237
|
-
"v-deep",
|
|
238
|
-
"v-global",
|
|
239
|
-
"v-slotted"
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
],
|
|
243
|
-
...scss ? {
|
|
244
|
-
"function-no-unknown": null
|
|
245
|
-
} : {},
|
|
246
256
|
...options.overrides
|
|
247
257
|
}
|
|
248
258
|
}
|
|
@@ -270,20 +280,29 @@ function isPkgExists(pkg) {
|
|
|
270
280
|
|
|
271
281
|
function defineConfig(options = {}, ...userOverrides) {
|
|
272
282
|
const {
|
|
273
|
-
css: enableCss = true,
|
|
274
|
-
html: enableHtml = true,
|
|
275
283
|
scss: enableScss = isPkgExists(SCSS_PACKAGES),
|
|
284
|
+
html: enableHtml = true,
|
|
276
285
|
vue: enableVue = isPkgExists(VUE_PACKAGES)
|
|
277
286
|
} = options;
|
|
278
287
|
const overrides = [
|
|
288
|
+
...setup({
|
|
289
|
+
scss: !!enableScss,
|
|
290
|
+
html: !!enableHtml,
|
|
291
|
+
vue: !!enableVue
|
|
292
|
+
}),
|
|
279
293
|
...core({
|
|
280
|
-
overrides: getOverrides(options.core)
|
|
294
|
+
overrides: getOverrides(options.core),
|
|
295
|
+
vue: !!enableVue
|
|
296
|
+
}),
|
|
297
|
+
...css({
|
|
298
|
+
overrides: getOverrides(options.css)
|
|
281
299
|
})
|
|
282
300
|
];
|
|
283
|
-
if (
|
|
301
|
+
if (enableScss) {
|
|
284
302
|
overrides.push(
|
|
285
|
-
...
|
|
286
|
-
overrides: getOverrides(options.
|
|
303
|
+
...scss({
|
|
304
|
+
overrides: getOverrides(options.scss),
|
|
305
|
+
vue: !!enableVue
|
|
287
306
|
})
|
|
288
307
|
);
|
|
289
308
|
}
|
|
@@ -294,18 +313,10 @@ function defineConfig(options = {}, ...userOverrides) {
|
|
|
294
313
|
})
|
|
295
314
|
);
|
|
296
315
|
}
|
|
297
|
-
if (enableScss) {
|
|
298
|
-
overrides.push(
|
|
299
|
-
...scss({
|
|
300
|
-
overrides: getOverrides(options.scss)
|
|
301
|
-
})
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
316
|
if (enableVue) {
|
|
305
317
|
overrides.push(
|
|
306
318
|
...vue({
|
|
307
|
-
overrides: getOverrides(options.vue)
|
|
308
|
-
scss: !!enableScss
|
|
319
|
+
overrides: getOverrides(options.vue)
|
|
309
320
|
})
|
|
310
321
|
);
|
|
311
322
|
}
|