@icebreakers/stylelint-config 0.0.2 → 0.0.4
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/{chunk-CIZRL5LZ.js → chunk-63UB2FUI.js} +2 -2
- package/dist/cli.cjs +119 -119
- package/dist/cli.js +118 -118
- package/dist/index.cjs +84 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +86 -3
- package/package.json +11 -3
|
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.3.0_jiti@2.0.0_postcss@8.4.41_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
var init_esm_shims = __esm({
|
|
32
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
32
|
+
"../../node_modules/.pnpm/tsup@8.3.0_jiti@2.0.0_postcss@8.4.41_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
33
|
"use strict";
|
|
34
34
|
}
|
|
35
35
|
});
|
package/dist/cli.cjs
CHANGED
|
@@ -28,13 +28,114 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
31
|
+
// ../../node_modules/.pnpm/tsup@8.3.0_jiti@2.0.0_postcss@8.4.41_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js
|
|
32
32
|
var init_cjs_shims = __esm({
|
|
33
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
33
|
+
"../../node_modules/.pnpm/tsup@8.3.0_jiti@2.0.0_postcss@8.4.41_tsx@4.19.1_typescript@5.6.2_yaml@2.5.1/node_modules/tsup/assets/cjs_shims.js"() {
|
|
34
34
|
"use strict";
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
39
|
+
var require_isobject = __commonJS({
|
|
40
|
+
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports2, module2) {
|
|
41
|
+
"use strict";
|
|
42
|
+
init_cjs_shims();
|
|
43
|
+
module2.exports = function isObject(val) {
|
|
44
|
+
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
|
|
50
|
+
var require_get_value = __commonJS({
|
|
51
|
+
"../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports2, module2) {
|
|
52
|
+
"use strict";
|
|
53
|
+
init_cjs_shims();
|
|
54
|
+
var isObject = require_isobject();
|
|
55
|
+
module2.exports = function(target, path, options) {
|
|
56
|
+
if (!isObject(options)) {
|
|
57
|
+
options = { default: options };
|
|
58
|
+
}
|
|
59
|
+
if (!isValidObject(target)) {
|
|
60
|
+
return typeof options.default !== "undefined" ? options.default : target;
|
|
61
|
+
}
|
|
62
|
+
if (typeof path === "number") {
|
|
63
|
+
path = String(path);
|
|
64
|
+
}
|
|
65
|
+
const isArray = Array.isArray(path);
|
|
66
|
+
const isString = typeof path === "string";
|
|
67
|
+
const splitChar = options.separator || ".";
|
|
68
|
+
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
69
|
+
if (!isString && !isArray) {
|
|
70
|
+
return target;
|
|
71
|
+
}
|
|
72
|
+
if (isString && path in target) {
|
|
73
|
+
return isValid(path, target, options) ? target[path] : options.default;
|
|
74
|
+
}
|
|
75
|
+
let segs = isArray ? path : split(path, splitChar, options);
|
|
76
|
+
let len = segs.length;
|
|
77
|
+
let idx = 0;
|
|
78
|
+
do {
|
|
79
|
+
let prop = segs[idx];
|
|
80
|
+
if (typeof prop === "number") {
|
|
81
|
+
prop = String(prop);
|
|
82
|
+
}
|
|
83
|
+
while (prop && prop.slice(-1) === "\\") {
|
|
84
|
+
prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
85
|
+
}
|
|
86
|
+
if (prop in target) {
|
|
87
|
+
if (!isValid(prop, target, options)) {
|
|
88
|
+
return options.default;
|
|
89
|
+
}
|
|
90
|
+
target = target[prop];
|
|
91
|
+
} else {
|
|
92
|
+
let hasProp = false;
|
|
93
|
+
let n = idx + 1;
|
|
94
|
+
while (n < len) {
|
|
95
|
+
prop = join([prop, segs[n++]], joinChar, options);
|
|
96
|
+
if (hasProp = prop in target) {
|
|
97
|
+
if (!isValid(prop, target, options)) {
|
|
98
|
+
return options.default;
|
|
99
|
+
}
|
|
100
|
+
target = target[prop];
|
|
101
|
+
idx = n - 1;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!hasProp) {
|
|
106
|
+
return options.default;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
} while (++idx < len && isValidObject(target));
|
|
110
|
+
if (idx === len) {
|
|
111
|
+
return target;
|
|
112
|
+
}
|
|
113
|
+
return options.default;
|
|
114
|
+
};
|
|
115
|
+
function join(segs, joinChar, options) {
|
|
116
|
+
if (typeof options.join === "function") {
|
|
117
|
+
return options.join(segs);
|
|
118
|
+
}
|
|
119
|
+
return segs[0] + joinChar + segs[1];
|
|
120
|
+
}
|
|
121
|
+
function split(path, splitChar, options) {
|
|
122
|
+
if (typeof options.split === "function") {
|
|
123
|
+
return options.split(path);
|
|
124
|
+
}
|
|
125
|
+
return path.split(splitChar);
|
|
126
|
+
}
|
|
127
|
+
function isValid(key, target, options) {
|
|
128
|
+
if (typeof options.isValid === "function") {
|
|
129
|
+
return options.isValid(key, target);
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
function isValidObject(val) {
|
|
134
|
+
return isObject(val) || Array.isArray(val) || typeof val === "function";
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
38
139
|
// ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
|
|
39
140
|
var require_is_primitive = __commonJS({
|
|
40
141
|
"../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js"(exports2, module2) {
|
|
@@ -49,17 +150,6 @@ var require_is_primitive = __commonJS({
|
|
|
49
150
|
}
|
|
50
151
|
});
|
|
51
152
|
|
|
52
|
-
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
53
|
-
var require_isobject = __commonJS({
|
|
54
|
-
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports2, module2) {
|
|
55
|
-
"use strict";
|
|
56
|
-
init_cjs_shims();
|
|
57
|
-
module2.exports = function isObject(val) {
|
|
58
|
-
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
153
|
// ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
|
|
64
154
|
var require_is_plain_object = __commonJS({
|
|
65
155
|
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports2, module2) {
|
|
@@ -214,107 +304,17 @@ var require_set_value = __commonJS({
|
|
|
214
304
|
}
|
|
215
305
|
});
|
|
216
306
|
|
|
217
|
-
// ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
|
|
218
|
-
var require_get_value = __commonJS({
|
|
219
|
-
"../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports2, module2) {
|
|
220
|
-
"use strict";
|
|
221
|
-
init_cjs_shims();
|
|
222
|
-
var isObject = require_isobject();
|
|
223
|
-
module2.exports = function(target, path, options) {
|
|
224
|
-
if (!isObject(options)) {
|
|
225
|
-
options = { default: options };
|
|
226
|
-
}
|
|
227
|
-
if (!isValidObject(target)) {
|
|
228
|
-
return typeof options.default !== "undefined" ? options.default : target;
|
|
229
|
-
}
|
|
230
|
-
if (typeof path === "number") {
|
|
231
|
-
path = String(path);
|
|
232
|
-
}
|
|
233
|
-
const isArray = Array.isArray(path);
|
|
234
|
-
const isString = typeof path === "string";
|
|
235
|
-
const splitChar = options.separator || ".";
|
|
236
|
-
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
237
|
-
if (!isString && !isArray) {
|
|
238
|
-
return target;
|
|
239
|
-
}
|
|
240
|
-
if (isString && path in target) {
|
|
241
|
-
return isValid(path, target, options) ? target[path] : options.default;
|
|
242
|
-
}
|
|
243
|
-
let segs = isArray ? path : split(path, splitChar, options);
|
|
244
|
-
let len = segs.length;
|
|
245
|
-
let idx = 0;
|
|
246
|
-
do {
|
|
247
|
-
let prop = segs[idx];
|
|
248
|
-
if (typeof prop === "number") {
|
|
249
|
-
prop = String(prop);
|
|
250
|
-
}
|
|
251
|
-
while (prop && prop.slice(-1) === "\\") {
|
|
252
|
-
prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
253
|
-
}
|
|
254
|
-
if (prop in target) {
|
|
255
|
-
if (!isValid(prop, target, options)) {
|
|
256
|
-
return options.default;
|
|
257
|
-
}
|
|
258
|
-
target = target[prop];
|
|
259
|
-
} else {
|
|
260
|
-
let hasProp = false;
|
|
261
|
-
let n = idx + 1;
|
|
262
|
-
while (n < len) {
|
|
263
|
-
prop = join([prop, segs[n++]], joinChar, options);
|
|
264
|
-
if (hasProp = prop in target) {
|
|
265
|
-
if (!isValid(prop, target, options)) {
|
|
266
|
-
return options.default;
|
|
267
|
-
}
|
|
268
|
-
target = target[prop];
|
|
269
|
-
idx = n - 1;
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
if (!hasProp) {
|
|
274
|
-
return options.default;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
} while (++idx < len && isValidObject(target));
|
|
278
|
-
if (idx === len) {
|
|
279
|
-
return target;
|
|
280
|
-
}
|
|
281
|
-
return options.default;
|
|
282
|
-
};
|
|
283
|
-
function join(segs, joinChar, options) {
|
|
284
|
-
if (typeof options.join === "function") {
|
|
285
|
-
return options.join(segs);
|
|
286
|
-
}
|
|
287
|
-
return segs[0] + joinChar + segs[1];
|
|
288
|
-
}
|
|
289
|
-
function split(path, splitChar, options) {
|
|
290
|
-
if (typeof options.split === "function") {
|
|
291
|
-
return options.split(path);
|
|
292
|
-
}
|
|
293
|
-
return path.split(splitChar);
|
|
294
|
-
}
|
|
295
|
-
function isValid(key, target, options) {
|
|
296
|
-
if (typeof options.isValid === "function") {
|
|
297
|
-
return options.isValid(key, target);
|
|
298
|
-
}
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
function isValidObject(val) {
|
|
302
|
-
return isObject(val) || Array.isArray(val) || typeof val === "function";
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
307
|
// src/cli.ts
|
|
308
308
|
init_cjs_shims();
|
|
309
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
310
309
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
311
310
|
var import_node_path = require("path");
|
|
311
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
312
312
|
var import_comment_json = __toESM(require("comment-json"), 1);
|
|
313
313
|
|
|
314
314
|
// src/shared.ts
|
|
315
315
|
init_cjs_shims();
|
|
316
|
-
var import_set_value = __toESM(require_set_value(), 1);
|
|
317
316
|
var import_get_value = __toESM(require_get_value(), 1);
|
|
317
|
+
var import_set_value = __toESM(require_set_value(), 1);
|
|
318
318
|
function setVscodeSettingsJson(json2 = {}) {
|
|
319
319
|
(0, import_set_value.default)(json2, "css\\.validate", false);
|
|
320
320
|
(0, import_set_value.default)(json2, "less\\.validate", false);
|
|
@@ -346,19 +346,27 @@ import_node_fs.default.writeFileSync(vscodeSettingsFilename, import_comment_json
|
|
|
346
346
|
console.info(`[@icebreakers/stylelint-config] ${isExisted ? "update" : "init"} '.vscode/settings.json' finished`);
|
|
347
347
|
/*! Bundled license information:
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
isobject/index.js:
|
|
350
350
|
(*!
|
|
351
|
-
*
|
|
351
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
352
352
|
*
|
|
353
|
-
* Copyright (c) 2014-
|
|
353
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
354
354
|
* Released under the MIT License.
|
|
355
355
|
*)
|
|
356
356
|
|
|
357
|
-
|
|
357
|
+
get-value/index.js:
|
|
358
358
|
(*!
|
|
359
|
-
*
|
|
359
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
360
360
|
*
|
|
361
|
-
* Copyright (c) 2014-
|
|
361
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
362
|
+
* Released under the MIT License.
|
|
363
|
+
*)
|
|
364
|
+
|
|
365
|
+
is-primitive/index.js:
|
|
366
|
+
(*!
|
|
367
|
+
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
|
368
|
+
*
|
|
369
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
362
370
|
* Released under the MIT License.
|
|
363
371
|
*)
|
|
364
372
|
|
|
@@ -377,12 +385,4 @@ set-value/index.js:
|
|
|
377
385
|
* Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
|
|
378
386
|
* Released under the MIT License.
|
|
379
387
|
*)
|
|
380
|
-
|
|
381
|
-
get-value/index.js:
|
|
382
|
-
(*!
|
|
383
|
-
* get-value <https://github.com/jonschlinkert/get-value>
|
|
384
|
-
*
|
|
385
|
-
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
386
|
-
* Released under the MIT License.
|
|
387
|
-
*)
|
|
388
388
|
*/
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,108 @@ import {
|
|
|
2
2
|
__commonJS,
|
|
3
3
|
__toESM,
|
|
4
4
|
init_esm_shims
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-63UB2FUI.js";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
8
|
+
var require_isobject = __commonJS({
|
|
9
|
+
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
|
|
10
|
+
"use strict";
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
module.exports = function isObject(val) {
|
|
13
|
+
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
|
|
19
|
+
var require_get_value = __commonJS({
|
|
20
|
+
"../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
|
|
21
|
+
"use strict";
|
|
22
|
+
init_esm_shims();
|
|
23
|
+
var isObject = require_isobject();
|
|
24
|
+
module.exports = function(target, path, options) {
|
|
25
|
+
if (!isObject(options)) {
|
|
26
|
+
options = { default: options };
|
|
27
|
+
}
|
|
28
|
+
if (!isValidObject(target)) {
|
|
29
|
+
return typeof options.default !== "undefined" ? options.default : target;
|
|
30
|
+
}
|
|
31
|
+
if (typeof path === "number") {
|
|
32
|
+
path = String(path);
|
|
33
|
+
}
|
|
34
|
+
const isArray = Array.isArray(path);
|
|
35
|
+
const isString = typeof path === "string";
|
|
36
|
+
const splitChar = options.separator || ".";
|
|
37
|
+
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
38
|
+
if (!isString && !isArray) {
|
|
39
|
+
return target;
|
|
40
|
+
}
|
|
41
|
+
if (isString && path in target) {
|
|
42
|
+
return isValid(path, target, options) ? target[path] : options.default;
|
|
43
|
+
}
|
|
44
|
+
let segs = isArray ? path : split(path, splitChar, options);
|
|
45
|
+
let len = segs.length;
|
|
46
|
+
let idx = 0;
|
|
47
|
+
do {
|
|
48
|
+
let prop = segs[idx];
|
|
49
|
+
if (typeof prop === "number") {
|
|
50
|
+
prop = String(prop);
|
|
51
|
+
}
|
|
52
|
+
while (prop && prop.slice(-1) === "\\") {
|
|
53
|
+
prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
54
|
+
}
|
|
55
|
+
if (prop in target) {
|
|
56
|
+
if (!isValid(prop, target, options)) {
|
|
57
|
+
return options.default;
|
|
58
|
+
}
|
|
59
|
+
target = target[prop];
|
|
60
|
+
} else {
|
|
61
|
+
let hasProp = false;
|
|
62
|
+
let n = idx + 1;
|
|
63
|
+
while (n < len) {
|
|
64
|
+
prop = join([prop, segs[n++]], joinChar, options);
|
|
65
|
+
if (hasProp = prop in target) {
|
|
66
|
+
if (!isValid(prop, target, options)) {
|
|
67
|
+
return options.default;
|
|
68
|
+
}
|
|
69
|
+
target = target[prop];
|
|
70
|
+
idx = n - 1;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!hasProp) {
|
|
75
|
+
return options.default;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} while (++idx < len && isValidObject(target));
|
|
79
|
+
if (idx === len) {
|
|
80
|
+
return target;
|
|
81
|
+
}
|
|
82
|
+
return options.default;
|
|
83
|
+
};
|
|
84
|
+
function join(segs, joinChar, options) {
|
|
85
|
+
if (typeof options.join === "function") {
|
|
86
|
+
return options.join(segs);
|
|
87
|
+
}
|
|
88
|
+
return segs[0] + joinChar + segs[1];
|
|
89
|
+
}
|
|
90
|
+
function split(path, splitChar, options) {
|
|
91
|
+
if (typeof options.split === "function") {
|
|
92
|
+
return options.split(path);
|
|
93
|
+
}
|
|
94
|
+
return path.split(splitChar);
|
|
95
|
+
}
|
|
96
|
+
function isValid(key, target, options) {
|
|
97
|
+
if (typeof options.isValid === "function") {
|
|
98
|
+
return options.isValid(key, target);
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
function isValidObject(val) {
|
|
103
|
+
return isObject(val) || Array.isArray(val) || typeof val === "function";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
6
107
|
|
|
7
108
|
// ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
|
|
8
109
|
var require_is_primitive = __commonJS({
|
|
@@ -18,17 +119,6 @@ var require_is_primitive = __commonJS({
|
|
|
18
119
|
}
|
|
19
120
|
});
|
|
20
121
|
|
|
21
|
-
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
22
|
-
var require_isobject = __commonJS({
|
|
23
|
-
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
|
|
24
|
-
"use strict";
|
|
25
|
-
init_esm_shims();
|
|
26
|
-
module.exports = function isObject(val) {
|
|
27
|
-
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
122
|
// ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
|
|
33
123
|
var require_is_plain_object = __commonJS({
|
|
34
124
|
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
|
|
@@ -183,107 +273,17 @@ var require_set_value = __commonJS({
|
|
|
183
273
|
}
|
|
184
274
|
});
|
|
185
275
|
|
|
186
|
-
// ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
|
|
187
|
-
var require_get_value = __commonJS({
|
|
188
|
-
"../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
|
|
189
|
-
"use strict";
|
|
190
|
-
init_esm_shims();
|
|
191
|
-
var isObject = require_isobject();
|
|
192
|
-
module.exports = function(target, path, options) {
|
|
193
|
-
if (!isObject(options)) {
|
|
194
|
-
options = { default: options };
|
|
195
|
-
}
|
|
196
|
-
if (!isValidObject(target)) {
|
|
197
|
-
return typeof options.default !== "undefined" ? options.default : target;
|
|
198
|
-
}
|
|
199
|
-
if (typeof path === "number") {
|
|
200
|
-
path = String(path);
|
|
201
|
-
}
|
|
202
|
-
const isArray = Array.isArray(path);
|
|
203
|
-
const isString = typeof path === "string";
|
|
204
|
-
const splitChar = options.separator || ".";
|
|
205
|
-
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
206
|
-
if (!isString && !isArray) {
|
|
207
|
-
return target;
|
|
208
|
-
}
|
|
209
|
-
if (isString && path in target) {
|
|
210
|
-
return isValid(path, target, options) ? target[path] : options.default;
|
|
211
|
-
}
|
|
212
|
-
let segs = isArray ? path : split(path, splitChar, options);
|
|
213
|
-
let len = segs.length;
|
|
214
|
-
let idx = 0;
|
|
215
|
-
do {
|
|
216
|
-
let prop = segs[idx];
|
|
217
|
-
if (typeof prop === "number") {
|
|
218
|
-
prop = String(prop);
|
|
219
|
-
}
|
|
220
|
-
while (prop && prop.slice(-1) === "\\") {
|
|
221
|
-
prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
222
|
-
}
|
|
223
|
-
if (prop in target) {
|
|
224
|
-
if (!isValid(prop, target, options)) {
|
|
225
|
-
return options.default;
|
|
226
|
-
}
|
|
227
|
-
target = target[prop];
|
|
228
|
-
} else {
|
|
229
|
-
let hasProp = false;
|
|
230
|
-
let n = idx + 1;
|
|
231
|
-
while (n < len) {
|
|
232
|
-
prop = join([prop, segs[n++]], joinChar, options);
|
|
233
|
-
if (hasProp = prop in target) {
|
|
234
|
-
if (!isValid(prop, target, options)) {
|
|
235
|
-
return options.default;
|
|
236
|
-
}
|
|
237
|
-
target = target[prop];
|
|
238
|
-
idx = n - 1;
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (!hasProp) {
|
|
243
|
-
return options.default;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
} while (++idx < len && isValidObject(target));
|
|
247
|
-
if (idx === len) {
|
|
248
|
-
return target;
|
|
249
|
-
}
|
|
250
|
-
return options.default;
|
|
251
|
-
};
|
|
252
|
-
function join(segs, joinChar, options) {
|
|
253
|
-
if (typeof options.join === "function") {
|
|
254
|
-
return options.join(segs);
|
|
255
|
-
}
|
|
256
|
-
return segs[0] + joinChar + segs[1];
|
|
257
|
-
}
|
|
258
|
-
function split(path, splitChar, options) {
|
|
259
|
-
if (typeof options.split === "function") {
|
|
260
|
-
return options.split(path);
|
|
261
|
-
}
|
|
262
|
-
return path.split(splitChar);
|
|
263
|
-
}
|
|
264
|
-
function isValid(key, target, options) {
|
|
265
|
-
if (typeof options.isValid === "function") {
|
|
266
|
-
return options.isValid(key, target);
|
|
267
|
-
}
|
|
268
|
-
return true;
|
|
269
|
-
}
|
|
270
|
-
function isValidObject(val) {
|
|
271
|
-
return isObject(val) || Array.isArray(val) || typeof val === "function";
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
|
|
276
276
|
// src/cli.ts
|
|
277
277
|
init_esm_shims();
|
|
278
|
-
import process from "node:process";
|
|
279
278
|
import fs from "node:fs";
|
|
280
279
|
import { resolve } from "node:path";
|
|
280
|
+
import process from "node:process";
|
|
281
281
|
import jsonc from "comment-json";
|
|
282
282
|
|
|
283
283
|
// src/shared.ts
|
|
284
284
|
init_esm_shims();
|
|
285
|
-
var import_set_value = __toESM(require_set_value(), 1);
|
|
286
285
|
var import_get_value = __toESM(require_get_value(), 1);
|
|
286
|
+
var import_set_value = __toESM(require_set_value(), 1);
|
|
287
287
|
function setVscodeSettingsJson(json2 = {}) {
|
|
288
288
|
(0, import_set_value.default)(json2, "css\\.validate", false);
|
|
289
289
|
(0, import_set_value.default)(json2, "less\\.validate", false);
|
|
@@ -315,19 +315,27 @@ fs.writeFileSync(vscodeSettingsFilename, jsonc.stringify(json, void 0, 2), "utf8
|
|
|
315
315
|
console.info(`[@icebreakers/stylelint-config] ${isExisted ? "update" : "init"} '.vscode/settings.json' finished`);
|
|
316
316
|
/*! Bundled license information:
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
isobject/index.js:
|
|
319
319
|
(*!
|
|
320
|
-
*
|
|
320
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
321
321
|
*
|
|
322
|
-
* Copyright (c) 2014-
|
|
322
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
323
323
|
* Released under the MIT License.
|
|
324
324
|
*)
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
get-value/index.js:
|
|
327
327
|
(*!
|
|
328
|
-
*
|
|
328
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
329
329
|
*
|
|
330
|
-
* Copyright (c) 2014-
|
|
330
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
331
|
+
* Released under the MIT License.
|
|
332
|
+
*)
|
|
333
|
+
|
|
334
|
+
is-primitive/index.js:
|
|
335
|
+
(*!
|
|
336
|
+
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
|
337
|
+
*
|
|
338
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
331
339
|
* Released under the MIT License.
|
|
332
340
|
*)
|
|
333
341
|
|
|
@@ -346,12 +354,4 @@ set-value/index.js:
|
|
|
346
354
|
* Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
|
|
347
355
|
* Released under the MIT License.
|
|
348
356
|
*)
|
|
349
|
-
|
|
350
|
-
get-value/index.js:
|
|
351
|
-
(*!
|
|
352
|
-
* get-value <https://github.com/jonschlinkert/get-value>
|
|
353
|
-
*
|
|
354
|
-
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
355
|
-
* Released under the MIT License.
|
|
356
|
-
*)
|
|
357
357
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,77 @@ __export(src_exports, {
|
|
|
23
23
|
icebreaker: () => icebreaker
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
28
|
+
function isPlainObject(value) {
|
|
29
|
+
if (value === null || typeof value !== "object") {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const prototype = Object.getPrototypeOf(value);
|
|
33
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (Symbol.iterator in value) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (Symbol.toStringTag in value) {
|
|
40
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
45
|
+
if (!isPlainObject(defaults)) {
|
|
46
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
47
|
+
}
|
|
48
|
+
const object = Object.assign({}, defaults);
|
|
49
|
+
for (const key in baseObject) {
|
|
50
|
+
if (key === "__proto__" || key === "constructor") {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const value = baseObject[key];
|
|
54
|
+
if (value === null || value === void 0) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
61
|
+
object[key] = [...value, ...object[key]];
|
|
62
|
+
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
63
|
+
object[key] = _defu(
|
|
64
|
+
value,
|
|
65
|
+
object[key],
|
|
66
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
67
|
+
merger
|
|
68
|
+
);
|
|
69
|
+
} else {
|
|
70
|
+
object[key] = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return object;
|
|
74
|
+
}
|
|
75
|
+
function createDefu(merger) {
|
|
76
|
+
return (...arguments_) => (
|
|
77
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
78
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
var defu = createDefu();
|
|
82
|
+
var defuFn = createDefu((object, key, currentValue) => {
|
|
83
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
84
|
+
object[key] = currentValue(object[key]);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
89
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
90
|
+
object[key] = currentValue(object[key]);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// src/index.ts
|
|
96
|
+
function createDefaultConfig() {
|
|
27
97
|
return {
|
|
28
98
|
extends: [
|
|
29
99
|
// extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss']
|
|
@@ -40,9 +110,21 @@ function icebreaker() {
|
|
|
40
110
|
// 'unit-allowed-list': ['em', 'rem', 's'],
|
|
41
111
|
// },
|
|
42
112
|
// },
|
|
43
|
-
]
|
|
113
|
+
],
|
|
114
|
+
rules: {
|
|
115
|
+
// https://stylelint.io/user-guide/rules/unit-no-unknown/#ignoreunits-regex-regex-string
|
|
116
|
+
"unit-no-unknown": [
|
|
117
|
+
true,
|
|
118
|
+
{
|
|
119
|
+
ignoreUnits: ["rpx"]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
44
123
|
};
|
|
45
124
|
}
|
|
125
|
+
function icebreaker(config) {
|
|
126
|
+
return defu(config, createDefaultConfig());
|
|
127
|
+
}
|
|
46
128
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
129
|
0 && (module.exports = {
|
|
48
130
|
icebreaker
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,81 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-63UB2FUI.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
init_esm_shims();
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
9
|
+
init_esm_shims();
|
|
10
|
+
function isPlainObject(value) {
|
|
11
|
+
if (value === null || typeof value !== "object") {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const prototype = Object.getPrototypeOf(value);
|
|
15
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (Symbol.iterator in value) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (Symbol.toStringTag in value) {
|
|
22
|
+
return Object.prototype.toString.call(value) === "[object Module]";
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
27
|
+
if (!isPlainObject(defaults)) {
|
|
28
|
+
return _defu(baseObject, {}, namespace, merger);
|
|
29
|
+
}
|
|
30
|
+
const object = Object.assign({}, defaults);
|
|
31
|
+
for (const key in baseObject) {
|
|
32
|
+
if (key === "__proto__" || key === "constructor") {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const value = baseObject[key];
|
|
36
|
+
if (value === null || value === void 0) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (merger && merger(object, key, value, namespace)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (Array.isArray(value) && Array.isArray(object[key])) {
|
|
43
|
+
object[key] = [...value, ...object[key]];
|
|
44
|
+
} else if (isPlainObject(value) && isPlainObject(object[key])) {
|
|
45
|
+
object[key] = _defu(
|
|
46
|
+
value,
|
|
47
|
+
object[key],
|
|
48
|
+
(namespace ? `${namespace}.` : "") + key.toString(),
|
|
49
|
+
merger
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
object[key] = value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return object;
|
|
56
|
+
}
|
|
57
|
+
function createDefu(merger) {
|
|
58
|
+
return (...arguments_) => (
|
|
59
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
60
|
+
arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
var defu = createDefu();
|
|
64
|
+
var defuFn = createDefu((object, key, currentValue) => {
|
|
65
|
+
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
66
|
+
object[key] = currentValue(object[key]);
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
71
|
+
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
72
|
+
object[key] = currentValue(object[key]);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// src/index.ts
|
|
78
|
+
function createDefaultConfig() {
|
|
8
79
|
return {
|
|
9
80
|
extends: [
|
|
10
81
|
// extends: ['stylelint-config-standard', 'stylelint-config-recommended-scss']
|
|
@@ -21,9 +92,21 @@ function icebreaker() {
|
|
|
21
92
|
// 'unit-allowed-list': ['em', 'rem', 's'],
|
|
22
93
|
// },
|
|
23
94
|
// },
|
|
24
|
-
]
|
|
95
|
+
],
|
|
96
|
+
rules: {
|
|
97
|
+
// https://stylelint.io/user-guide/rules/unit-no-unknown/#ignoreunits-regex-regex-string
|
|
98
|
+
"unit-no-unknown": [
|
|
99
|
+
true,
|
|
100
|
+
{
|
|
101
|
+
ignoreUnits: ["rpx"]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
25
105
|
};
|
|
26
106
|
}
|
|
107
|
+
function icebreaker(config) {
|
|
108
|
+
return defu(config, createDefaultConfig());
|
|
109
|
+
}
|
|
27
110
|
export {
|
|
28
111
|
icebreaker
|
|
29
112
|
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/stylelint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "icebreaker's stylelint config",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/sonofmagic/eslint-config.git",
|
|
11
|
+
"directory": "packages/stylelint"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/sonofmagic/eslint-config/issues"
|
|
15
|
+
},
|
|
8
16
|
"keywords": [
|
|
9
17
|
"stylelint"
|
|
10
18
|
],
|
|
@@ -41,6 +49,6 @@
|
|
|
41
49
|
"test": "vitest run",
|
|
42
50
|
"test:dev": "vitest",
|
|
43
51
|
"release": "pnpm publish",
|
|
44
|
-
"sync": "cnpm sync @icebreakers/
|
|
52
|
+
"sync": "cnpm sync @icebreakers/stylelint-config"
|
|
45
53
|
}
|
|
46
54
|
}
|