@xiaohe01/stylelint-config 2.3.3 → 2.4.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 +218 -308
- package/dist/index.d.cts +43 -40
- package/dist/index.d.ts +43 -40
- package/dist/index.js +237 -0
- package/package.json +6 -5
- package/dist/index.d.mts +0 -54
- package/dist/index.mjs +0 -348
package/dist/index.cjs
CHANGED
|
@@ -1,355 +1,265 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
2
22
|
|
|
3
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
const local_pkg = __toESM(require("local-pkg"));
|
|
4
25
|
|
|
26
|
+
//#region src/globs.ts
|
|
5
27
|
const GLOB_CSS = ["*.css", "**/*.css"];
|
|
6
28
|
const GLOB_SCSS = ["*.scss", "**/*.scss"];
|
|
7
29
|
const GLOB_HTML = ["*.html", "**/*.html"];
|
|
8
30
|
const GLOB_VUE = ["*.vue", "**/*.vue"];
|
|
9
31
|
const GLOB_ALL = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
...GLOB_CSS,
|
|
33
|
+
...GLOB_SCSS,
|
|
34
|
+
...GLOB_HTML,
|
|
35
|
+
...GLOB_VUE
|
|
14
36
|
];
|
|
15
37
|
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/configs/core.ts
|
|
16
40
|
function core(options = {}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"media-feature-name-no-unknown": true,
|
|
83
|
-
"media-feature-name-value-no-unknown": true,
|
|
84
|
-
"media-query-no-invalid": true,
|
|
85
|
-
"named-grid-areas-no-invalid": true,
|
|
86
|
-
"no-descending-specificity": true,
|
|
87
|
-
"no-duplicate-at-import-rules": true,
|
|
88
|
-
"no-duplicate-selectors": true,
|
|
89
|
-
"no-invalid-double-slash-comments": true,
|
|
90
|
-
"no-invalid-position-at-import-rule": true,
|
|
91
|
-
"no-irregular-whitespace": true,
|
|
92
|
-
"property-no-unknown": true,
|
|
93
|
-
"selector-anb-no-unmatchable": true,
|
|
94
|
-
"selector-class-pattern": [
|
|
95
|
-
"^([#a-z][$#{}a-z0-9]*)((-{1,2}|_{2})[$#{}a-z0-9]+)*$",
|
|
96
|
-
{
|
|
97
|
-
message(selector) {
|
|
98
|
-
return `Expected class selector "${selector}" to be the BEM style (block-element[__element][--modifier]).`;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"selector-not-notation": "simple",
|
|
103
|
-
"selector-pseudo-class-no-unknown": true,
|
|
104
|
-
"selector-pseudo-element-no-unknown": true,
|
|
105
|
-
"string-no-newline": [
|
|
106
|
-
true,
|
|
107
|
-
{
|
|
108
|
-
ignore: [
|
|
109
|
-
"at-rule-preludes",
|
|
110
|
-
"declaration-values"
|
|
111
|
-
]
|
|
112
|
-
}
|
|
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
|
-
} : {},
|
|
136
|
-
...options.overrides
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
];
|
|
41
|
+
const { vue: vue$1 = false } = options;
|
|
42
|
+
return [{
|
|
43
|
+
name: "xiaohe/core/rules",
|
|
44
|
+
files: GLOB_ALL,
|
|
45
|
+
extends: ["stylelint-config-recess-order"],
|
|
46
|
+
rules: {
|
|
47
|
+
"alpha-value-notation": "number",
|
|
48
|
+
"annotation-no-unknown": true,
|
|
49
|
+
"at-rule-descriptor-no-unknown": true,
|
|
50
|
+
"at-rule-descriptor-value-no-unknown": true,
|
|
51
|
+
"at-rule-no-deprecated": true,
|
|
52
|
+
"at-rule-no-unknown": true,
|
|
53
|
+
"at-rule-prelude-no-invalid": [true, { ignoreAtRules: ["media"] }],
|
|
54
|
+
"block-no-empty": true,
|
|
55
|
+
"color-function-notation": "legacy",
|
|
56
|
+
"color-hex-length": "long",
|
|
57
|
+
"comment-no-empty": true,
|
|
58
|
+
"custom-property-no-missing-var-function": true,
|
|
59
|
+
"declaration-block-no-duplicate-custom-properties": true,
|
|
60
|
+
"declaration-block-no-duplicate-properties": [true, { ignore: ["consecutive-duplicates-with-different-syntaxes"] }],
|
|
61
|
+
"declaration-block-no-redundant-longhand-properties": [true, { ignoreShorthands: ["inset"] }],
|
|
62
|
+
"declaration-block-no-shorthand-property-overrides": true,
|
|
63
|
+
"declaration-property-value-keyword-no-deprecated": true,
|
|
64
|
+
"font-family-no-duplicate-names": true,
|
|
65
|
+
"function-calc-no-unspaced-operator": true,
|
|
66
|
+
"keyframe-block-no-duplicate-selectors": true,
|
|
67
|
+
"keyframe-declaration-no-important": true,
|
|
68
|
+
"length-zero-no-unit": [true, {
|
|
69
|
+
ignore: ["custom-properties"],
|
|
70
|
+
ignoreFunctions: ["/^--/", "var"]
|
|
71
|
+
}],
|
|
72
|
+
"media-feature-name-no-unknown": true,
|
|
73
|
+
"media-feature-name-value-no-unknown": true,
|
|
74
|
+
"media-query-no-invalid": true,
|
|
75
|
+
"named-grid-areas-no-invalid": true,
|
|
76
|
+
"no-descending-specificity": true,
|
|
77
|
+
"no-duplicate-at-import-rules": true,
|
|
78
|
+
"no-duplicate-selectors": true,
|
|
79
|
+
"no-invalid-double-slash-comments": true,
|
|
80
|
+
"no-invalid-position-at-import-rule": true,
|
|
81
|
+
"no-irregular-whitespace": true,
|
|
82
|
+
"property-no-unknown": true,
|
|
83
|
+
"selector-anb-no-unmatchable": true,
|
|
84
|
+
"selector-class-pattern": ["^([#a-z][$#{}a-z0-9]*)((-{1,2}|_{2})[$#{}a-z0-9]+)*$", { message(selector) {
|
|
85
|
+
return `Expected class selector "${selector}" to be the BEM style (block-element[__element][--modifier]).`;
|
|
86
|
+
} }],
|
|
87
|
+
"selector-not-notation": "simple",
|
|
88
|
+
"selector-pseudo-class-no-unknown": true,
|
|
89
|
+
"selector-pseudo-element-no-unknown": true,
|
|
90
|
+
"string-no-newline": [true, { ignore: ["at-rule-preludes", "declaration-values"] }],
|
|
91
|
+
...vue$1 ? {
|
|
92
|
+
"selector-pseudo-class-no-unknown": [true, { ignorePseudoClasses: [
|
|
93
|
+
"deep",
|
|
94
|
+
"global",
|
|
95
|
+
"slotted"
|
|
96
|
+
] }],
|
|
97
|
+
"selector-pseudo-element-no-unknown": [true, { ignorePseudoElements: [
|
|
98
|
+
"v-deep",
|
|
99
|
+
"v-global",
|
|
100
|
+
"v-slotted"
|
|
101
|
+
] }]
|
|
102
|
+
} : {},
|
|
103
|
+
...options.overrides
|
|
104
|
+
}
|
|
105
|
+
}];
|
|
140
106
|
}
|
|
141
107
|
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/configs/css.ts
|
|
142
110
|
function css(options = {}) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
...options.overrides
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
];
|
|
111
|
+
return [{
|
|
112
|
+
name: "xiaohe/css/rules",
|
|
113
|
+
files: GLOB_CSS,
|
|
114
|
+
rules: { ...options.overrides }
|
|
115
|
+
}];
|
|
152
116
|
}
|
|
153
117
|
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/configs/html.ts
|
|
154
120
|
function html(options = {}) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
...options.overrides
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
];
|
|
121
|
+
return [{
|
|
122
|
+
name: "xiaohe/html/rules",
|
|
123
|
+
files: GLOB_HTML,
|
|
124
|
+
rules: { ...options.overrides }
|
|
125
|
+
}];
|
|
164
126
|
}
|
|
165
127
|
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/configs/scss.ts
|
|
166
130
|
function scss(options = {}) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
"scss/declaration-nested-properties-no-divided-groups": true,
|
|
198
|
-
"scss/dollar-variable-no-missing-interpolation": true,
|
|
199
|
-
"scss/function-quote-no-quoted-strings-inside": true,
|
|
200
|
-
"scss/function-unquote-no-unquoted-strings-inside": true,
|
|
201
|
-
"scss/load-no-partial-leading-underscore": true,
|
|
202
|
-
"scss/load-partial-extension": "never",
|
|
203
|
-
"scss/no-duplicate-mixins": true,
|
|
204
|
-
"scss/no-global-function-names": true,
|
|
205
|
-
"scss/operator-no-newline-after": true,
|
|
206
|
-
"scss/operator-no-newline-before": true,
|
|
207
|
-
"scss/operator-no-unspaced": true,
|
|
208
|
-
...uniapp ? {
|
|
209
|
-
"scss/load-partial-extension": "always"
|
|
210
|
-
} : {},
|
|
211
|
-
...options.overrides
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
];
|
|
131
|
+
const { vue: vue$1 = false, uniapp = false } = options;
|
|
132
|
+
return [{
|
|
133
|
+
name: "xiaohe/scss/rules",
|
|
134
|
+
files: [...GLOB_SCSS, ...vue$1 ? GLOB_VUE : []],
|
|
135
|
+
rules: {
|
|
136
|
+
"annotation-no-unknown": null,
|
|
137
|
+
"at-rule-no-unknown": null,
|
|
138
|
+
"comment-no-empty": null,
|
|
139
|
+
"function-no-unknown": null,
|
|
140
|
+
"media-query-no-invalid": null,
|
|
141
|
+
"no-invalid-position-at-import-rule": [true, { ignoreAtRules: ["use", "forward"] }],
|
|
142
|
+
"scss/at-extend-no-missing-placeholder": true,
|
|
143
|
+
"scss/at-if-no-null": true,
|
|
144
|
+
"scss/at-rule-no-unknown": true,
|
|
145
|
+
"scss/comment-no-empty": true,
|
|
146
|
+
"scss/declaration-nested-properties-no-divided-groups": true,
|
|
147
|
+
"scss/dollar-variable-no-missing-interpolation": true,
|
|
148
|
+
"scss/function-quote-no-quoted-strings-inside": true,
|
|
149
|
+
"scss/function-unquote-no-unquoted-strings-inside": true,
|
|
150
|
+
"scss/load-no-partial-leading-underscore": true,
|
|
151
|
+
"scss/load-partial-extension": "never",
|
|
152
|
+
"scss/no-duplicate-mixins": true,
|
|
153
|
+
"scss/no-global-function-names": true,
|
|
154
|
+
"scss/operator-no-newline-after": true,
|
|
155
|
+
"scss/operator-no-newline-before": true,
|
|
156
|
+
"scss/operator-no-unspaced": true,
|
|
157
|
+
...uniapp ? { "scss/load-partial-extension": "always" } : {},
|
|
158
|
+
...options.overrides
|
|
159
|
+
}
|
|
160
|
+
}];
|
|
215
161
|
}
|
|
216
162
|
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/configs/setup.ts
|
|
217
165
|
function setup(options = {}) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"stylelint-scss"
|
|
239
|
-
] : []
|
|
240
|
-
]
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
if (scss) {
|
|
244
|
-
overrides.push({
|
|
245
|
-
name: "xiaohe/scss/setup",
|
|
246
|
-
files: GLOB_SCSS,
|
|
247
|
-
customSyntax: "postcss-scss",
|
|
248
|
-
plugins: [
|
|
249
|
-
"stylelint-scss"
|
|
250
|
-
]
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
return overrides;
|
|
166
|
+
const { scss: scss$1 = false, html: html$1 = false, vue: vue$1 = false } = options;
|
|
167
|
+
const overrides = [];
|
|
168
|
+
if (html$1) overrides.push({
|
|
169
|
+
name: "xiaohe/html/setup",
|
|
170
|
+
files: GLOB_HTML,
|
|
171
|
+
customSyntax: "postcss-html"
|
|
172
|
+
});
|
|
173
|
+
if (vue$1) overrides.push({
|
|
174
|
+
name: "xiaohe/vue/setup",
|
|
175
|
+
files: GLOB_VUE,
|
|
176
|
+
customSyntax: "postcss-html",
|
|
177
|
+
plugins: [...scss$1 ? ["stylelint-scss"] : []]
|
|
178
|
+
});
|
|
179
|
+
if (scss$1) overrides.push({
|
|
180
|
+
name: "xiaohe/scss/setup",
|
|
181
|
+
files: GLOB_SCSS,
|
|
182
|
+
customSyntax: "postcss-scss",
|
|
183
|
+
plugins: ["stylelint-scss"]
|
|
184
|
+
});
|
|
185
|
+
return overrides;
|
|
254
186
|
}
|
|
255
187
|
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/configs/vue.ts
|
|
256
190
|
function vue(options = {}) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
...options.overrides
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
];
|
|
191
|
+
return [{
|
|
192
|
+
name: "xiaohe/vue/rules",
|
|
193
|
+
files: GLOB_VUE,
|
|
194
|
+
rules: { ...options.overrides }
|
|
195
|
+
}];
|
|
266
196
|
}
|
|
267
197
|
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/constants.ts
|
|
268
200
|
const SCSS_PACKAGES = [
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
201
|
+
"sass",
|
|
202
|
+
"sass-embedded",
|
|
203
|
+
"node-sass"
|
|
272
204
|
];
|
|
273
205
|
const VUE_PACKAGES = [
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
];
|
|
279
|
-
const UNIAPP_PACKAGES = [
|
|
280
|
-
"@dcloudio/uni-app"
|
|
206
|
+
"vue",
|
|
207
|
+
"nuxt",
|
|
208
|
+
"vitepress",
|
|
209
|
+
"@slidev/cli"
|
|
281
210
|
];
|
|
211
|
+
const UNIAPP_PACKAGES = ["@dcloudio/uni-app"];
|
|
282
212
|
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/helpers.ts
|
|
283
215
|
function castArray(value) {
|
|
284
|
-
|
|
216
|
+
return Array.isArray(value) ? value : [value];
|
|
285
217
|
}
|
|
286
218
|
function isPkgExists(pkg) {
|
|
287
|
-
|
|
219
|
+
return castArray(pkg).some((it) => (0, local_pkg.isPackageExists)(it));
|
|
288
220
|
}
|
|
289
221
|
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/factory.ts
|
|
290
224
|
function defineConfig(options = {}, ...userOverrides) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
if (enableHtml) {
|
|
321
|
-
overrides.push(
|
|
322
|
-
...html({
|
|
323
|
-
overrides: getOverrides(options.html)
|
|
324
|
-
})
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
if (enableVue) {
|
|
328
|
-
overrides.push(
|
|
329
|
-
...vue({
|
|
330
|
-
overrides: getOverrides(options.vue)
|
|
331
|
-
})
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
overrides.push(...userOverrides);
|
|
335
|
-
return {
|
|
336
|
-
defaultSeverity: "error",
|
|
337
|
-
allowEmptyInput: true,
|
|
338
|
-
overrides,
|
|
339
|
-
rules: {},
|
|
340
|
-
...options
|
|
341
|
-
};
|
|
225
|
+
const { scss: enableScss = isPkgExists(SCSS_PACKAGES), html: enableHtml = true, vue: enableVue = isPkgExists(VUE_PACKAGES), uniapp: enableUniApp = isPkgExists(UNIAPP_PACKAGES) } = options;
|
|
226
|
+
const overrides = [
|
|
227
|
+
...setup({
|
|
228
|
+
scss: !!enableScss,
|
|
229
|
+
html: !!enableHtml,
|
|
230
|
+
vue: !!enableVue
|
|
231
|
+
}),
|
|
232
|
+
...core({
|
|
233
|
+
overrides: getOverrides(options.core),
|
|
234
|
+
vue: !!enableVue
|
|
235
|
+
}),
|
|
236
|
+
...css({ overrides: getOverrides(options.css) })
|
|
237
|
+
];
|
|
238
|
+
if (enableScss) overrides.push(...scss({
|
|
239
|
+
overrides: getOverrides(options.scss),
|
|
240
|
+
vue: !!enableVue,
|
|
241
|
+
uniapp: enableUniApp
|
|
242
|
+
}));
|
|
243
|
+
if (enableHtml) overrides.push(...html({ overrides: getOverrides(options.html) }));
|
|
244
|
+
if (enableVue) overrides.push(...vue({ overrides: getOverrides(options.vue) }));
|
|
245
|
+
overrides.push(...userOverrides);
|
|
246
|
+
return {
|
|
247
|
+
defaultSeverity: "error",
|
|
248
|
+
allowEmptyInput: true,
|
|
249
|
+
overrides,
|
|
250
|
+
rules: {},
|
|
251
|
+
...options
|
|
252
|
+
};
|
|
342
253
|
}
|
|
343
254
|
function getOverrides(options) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
return options.overrides || {};
|
|
255
|
+
if (options == null || typeof options === "boolean") return {};
|
|
256
|
+
return options.overrides || {};
|
|
348
257
|
}
|
|
349
258
|
|
|
259
|
+
//#endregion
|
|
350
260
|
exports.GLOB_ALL = GLOB_ALL;
|
|
351
261
|
exports.GLOB_CSS = GLOB_CSS;
|
|
352
262
|
exports.GLOB_HTML = GLOB_HTML;
|
|
353
263
|
exports.GLOB_SCSS = GLOB_SCSS;
|
|
354
264
|
exports.GLOB_VUE = GLOB_VUE;
|
|
355
|
-
exports.defineConfig = defineConfig;
|
|
265
|
+
exports.defineConfig = defineConfig;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
import { Config } from
|
|
1
|
+
import { Config } from "stylelint";
|
|
2
2
|
|
|
3
|
+
//#region src/types.d.ts
|
|
3
4
|
type ConfigOverride = Omit<Config, "overrides"> & {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
files: string | string[];
|
|
6
|
+
name?: string;
|
|
6
7
|
};
|
|
7
8
|
type ConfigRules = Config["rules"];
|
|
8
9
|
interface OptionsOverrides {
|
|
9
|
-
|
|
10
|
+
overrides?: ConfigRules;
|
|
10
11
|
}
|
|
11
12
|
interface OptionsConfig {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Core rules. Can't be disabled.
|
|
15
|
+
*/
|
|
16
|
+
core?: OptionsOverrides;
|
|
17
|
+
/**
|
|
18
|
+
* CSS rules.
|
|
19
|
+
*/
|
|
20
|
+
css?: OptionsOverrides;
|
|
21
|
+
/**
|
|
22
|
+
* Enable Scss support.
|
|
23
|
+
*
|
|
24
|
+
* @default auto-detect based on the dependencies
|
|
25
|
+
*/
|
|
26
|
+
scss?: boolean | OptionsOverrides;
|
|
27
|
+
/**
|
|
28
|
+
* Enable HTML support.
|
|
29
|
+
*
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
html?: boolean | OptionsOverrides;
|
|
33
|
+
/**
|
|
34
|
+
* Enable Vue support.
|
|
35
|
+
*
|
|
36
|
+
* @default auto-detect based on the dependencies
|
|
37
|
+
*/
|
|
38
|
+
vue?: boolean | OptionsOverrides;
|
|
39
|
+
/**
|
|
40
|
+
* Enable uniapp support.
|
|
41
|
+
*
|
|
42
|
+
* @default auto-detect based on the dependencies
|
|
43
|
+
*/
|
|
44
|
+
uniapp?: boolean;
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/factory.d.ts
|
|
46
48
|
declare function defineConfig(options?: OptionsConfig & Omit<Config, "overrides">, ...userOverrides: ConfigOverride[]): Config;
|
|
47
|
-
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/globs.d.ts
|
|
48
51
|
declare const GLOB_CSS: string[];
|
|
49
52
|
declare const GLOB_SCSS: string[];
|
|
50
53
|
declare const GLOB_HTML: string[];
|
|
51
54
|
declare const GLOB_VUE: string[];
|
|
52
55
|
declare const GLOB_ALL: string[];
|
|
53
|
-
|
|
54
|
-
export { GLOB_ALL, GLOB_CSS, GLOB_HTML, GLOB_SCSS, GLOB_VUE, defineConfig };
|
|
56
|
+
//#endregion
|
|
57
|
+
export { GLOB_ALL, GLOB_CSS, GLOB_HTML, GLOB_SCSS, GLOB_VUE, defineConfig };
|