@icebreakers/stylelint-config 0.0.0 → 0.0.1
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/cli.cjs +11 -3
- package/dist/cli.js +11 -3
- package/dist/index.cjs +1 -0
- package/dist/index.js +1 -0
- package/package.json +8 -4
package/dist/cli.cjs
CHANGED
|
@@ -309,6 +309,7 @@ init_cjs_shims();
|
|
|
309
309
|
var import_node_process = __toESM(require("process"), 1);
|
|
310
310
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
311
311
|
var import_node_path = require("path");
|
|
312
|
+
var import_comment_json = __toESM(require("comment-json"), 1);
|
|
312
313
|
|
|
313
314
|
// src/shared.ts
|
|
314
315
|
init_cjs_shims();
|
|
@@ -320,6 +321,8 @@ function setVscodeSettingsJson(json2 = {}) {
|
|
|
320
321
|
(0, import_set_value.default)(json2, "scss\\.validate", false);
|
|
321
322
|
const stylelintValidates = new Set((0, import_get_value.default)(json2, "stylelint\\.validate", { default: [] }));
|
|
322
323
|
stylelintValidates.add("vue");
|
|
324
|
+
stylelintValidates.add("css");
|
|
325
|
+
stylelintValidates.add("scss");
|
|
323
326
|
(0, import_set_value.default)(json2, "stylelint\\.validate", Array.from(stylelintValidates));
|
|
324
327
|
return json2;
|
|
325
328
|
}
|
|
@@ -331,11 +334,16 @@ import_node_fs.default.mkdirSync((0, import_node_path.resolve)(cwd, ".vscode"),
|
|
|
331
334
|
});
|
|
332
335
|
var vscodeSettingsFilename = (0, import_node_path.resolve)(cwd, ".vscode/settings.json");
|
|
333
336
|
var json = {};
|
|
334
|
-
|
|
335
|
-
|
|
337
|
+
var isExisted = import_node_fs.default.existsSync(vscodeSettingsFilename);
|
|
338
|
+
if (isExisted) {
|
|
339
|
+
const value = import_comment_json.default.parse(import_node_fs.default.readFileSync(vscodeSettingsFilename, "utf8"));
|
|
340
|
+
if (value) {
|
|
341
|
+
json = value;
|
|
342
|
+
}
|
|
336
343
|
}
|
|
337
344
|
setVscodeSettingsJson(json);
|
|
338
|
-
import_node_fs.default.writeFileSync(vscodeSettingsFilename,
|
|
345
|
+
import_node_fs.default.writeFileSync(vscodeSettingsFilename, import_comment_json.default.stringify(json, void 0, 2), "utf8");
|
|
346
|
+
console.info(`[@icebreakers/stylelint-config] ${isExisted ? "update" : "init"} '.vscode/settings.json' finished`);
|
|
339
347
|
/*! Bundled license information:
|
|
340
348
|
|
|
341
349
|
is-primitive/index.js:
|
package/dist/cli.js
CHANGED
|
@@ -278,6 +278,7 @@ init_esm_shims();
|
|
|
278
278
|
import process from "node:process";
|
|
279
279
|
import fs from "node:fs";
|
|
280
280
|
import { resolve } from "node:path";
|
|
281
|
+
import jsonc from "comment-json";
|
|
281
282
|
|
|
282
283
|
// src/shared.ts
|
|
283
284
|
init_esm_shims();
|
|
@@ -289,6 +290,8 @@ function setVscodeSettingsJson(json2 = {}) {
|
|
|
289
290
|
(0, import_set_value.default)(json2, "scss\\.validate", false);
|
|
290
291
|
const stylelintValidates = new Set((0, import_get_value.default)(json2, "stylelint\\.validate", { default: [] }));
|
|
291
292
|
stylelintValidates.add("vue");
|
|
293
|
+
stylelintValidates.add("css");
|
|
294
|
+
stylelintValidates.add("scss");
|
|
292
295
|
(0, import_set_value.default)(json2, "stylelint\\.validate", Array.from(stylelintValidates));
|
|
293
296
|
return json2;
|
|
294
297
|
}
|
|
@@ -300,11 +303,16 @@ fs.mkdirSync(resolve(cwd, ".vscode"), {
|
|
|
300
303
|
});
|
|
301
304
|
var vscodeSettingsFilename = resolve(cwd, ".vscode/settings.json");
|
|
302
305
|
var json = {};
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
var isExisted = fs.existsSync(vscodeSettingsFilename);
|
|
307
|
+
if (isExisted) {
|
|
308
|
+
const value = jsonc.parse(fs.readFileSync(vscodeSettingsFilename, "utf8"));
|
|
309
|
+
if (value) {
|
|
310
|
+
json = value;
|
|
311
|
+
}
|
|
305
312
|
}
|
|
306
313
|
setVscodeSettingsJson(json);
|
|
307
|
-
fs.writeFileSync(vscodeSettingsFilename,
|
|
314
|
+
fs.writeFileSync(vscodeSettingsFilename, jsonc.stringify(json, void 0, 2), "utf8");
|
|
315
|
+
console.info(`[@icebreakers/stylelint-config] ${isExisted ? "update" : "init"} '.vscode/settings.json' finished`);
|
|
308
316
|
/*! Bundled license information:
|
|
309
317
|
|
|
310
318
|
is-primitive/index.js:
|
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ function icebreaker() {
|
|
|
32
32
|
// https://github.com/ota-meshi/stylelint-config-recommended-vue/blob/main/scss/index.js
|
|
33
33
|
"stylelint-config-recommended-vue/scss"
|
|
34
34
|
],
|
|
35
|
+
// .map(module => require.resolve(module)),
|
|
35
36
|
overrides: [
|
|
36
37
|
// {
|
|
37
38
|
// files: ['*.vue', '**/*.vue'],
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ function icebreaker() {
|
|
|
13
13
|
// https://github.com/ota-meshi/stylelint-config-recommended-vue/blob/main/scss/index.js
|
|
14
14
|
"stylelint-config-recommended-vue/scss"
|
|
15
15
|
],
|
|
16
|
+
// .map(module => require.resolve(module)),
|
|
16
17
|
overrides: [
|
|
17
18
|
// {
|
|
18
19
|
// files: ['*.vue', '**/*.vue'],
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/stylelint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "icebreaker's stylelint config",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"keywords": [
|
|
8
|
+
"keywords": [
|
|
9
|
+
"stylelint"
|
|
10
|
+
],
|
|
9
11
|
"sideEffects": false,
|
|
10
12
|
"exports": {
|
|
11
13
|
".": {
|
|
@@ -23,9 +25,11 @@
|
|
|
23
25
|
"dist"
|
|
24
26
|
],
|
|
25
27
|
"dependencies": {
|
|
28
|
+
"comment-json": "^4.2.5",
|
|
26
29
|
"postcss-html": "^1.7.0",
|
|
27
30
|
"stylelint-config-recommended-scss": "^14.1.0",
|
|
28
|
-
"stylelint-config-recommended-vue": "^1.5.0"
|
|
31
|
+
"stylelint-config-recommended-vue": "^1.5.0",
|
|
32
|
+
"stylelint-config-standard-scss": "^13.1.0"
|
|
29
33
|
},
|
|
30
34
|
"publishConfig": {
|
|
31
35
|
"access": "public",
|