@powerlines/plugin-stylelint 0.1.460 → 0.1.462
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/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/index.cjs +60 -1
- package/dist/index.mjs +56 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +4 -4
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
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") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
4
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
5
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
6
|
+
let defu = require("defu");
|
|
7
|
+
let stylelint = require("stylelint");
|
|
8
|
+
stylelint = require_runtime.__toESM(stylelint, 1);
|
|
9
|
+
|
|
10
|
+
//#region src/index.ts
|
|
11
|
+
/**
|
|
12
|
+
* A Powerlines plugin to assist in linting stylesheets with Stylelint.
|
|
13
|
+
*/
|
|
14
|
+
function plugin(options = {}) {
|
|
15
|
+
return {
|
|
16
|
+
name: "stylelint",
|
|
17
|
+
async config() {
|
|
18
|
+
this.debug("Providing default configuration for the Powerlines `stylelint` build plugin.");
|
|
19
|
+
return { stylelint: (0, defu.defu)(options, {
|
|
20
|
+
configFile: (0, _stryke_fs_get_parent_path.getParentPath)([
|
|
21
|
+
"stylelint.config.js",
|
|
22
|
+
"stylelint.config.mjs",
|
|
23
|
+
"stylelint.config.cjs",
|
|
24
|
+
"stylelint.config.ts",
|
|
25
|
+
"stylelint.config.mts",
|
|
26
|
+
"stylelint.config.cts",
|
|
27
|
+
".stylelintrc.js",
|
|
28
|
+
".stylelintrc.cjs",
|
|
29
|
+
".stylelintrc.yaml",
|
|
30
|
+
".stylelintrc.yml",
|
|
31
|
+
".stylelintrc.json",
|
|
32
|
+
".stylelintrc"
|
|
33
|
+
], this.config.root, {
|
|
34
|
+
ignoreCase: true,
|
|
35
|
+
skipCwd: false,
|
|
36
|
+
includeNameInResults: true
|
|
37
|
+
}),
|
|
38
|
+
cwd: (0, _stryke_path_join.joinPaths)(this.config.cwd, this.config.root),
|
|
39
|
+
silent: this.config.logLevel !== null,
|
|
40
|
+
fix: true
|
|
41
|
+
}) };
|
|
42
|
+
},
|
|
43
|
+
async lint() {
|
|
44
|
+
this.debug(`Linting project files with Stylelint.`);
|
|
45
|
+
const result = await stylelint.default.lint(options);
|
|
46
|
+
if (this.config.stylelint.outputFile) await this.fs.write((0, _stryke_path_append.appendPath)(this.config.stylelint.outputFile, this.config.root), result.report);
|
|
47
|
+
if (!this.config.stylelint.silent) {
|
|
48
|
+
this.info(result.report);
|
|
49
|
+
const totalWarnings = result.results.map((res) => res.warnings.filter((warn) => warn.severity === "warning")).reduce((prev, res) => prev + res.length, 0);
|
|
50
|
+
if (totalWarnings > 0) this.warn(`${totalWarnings} Stylelint linting warnings found in the listed files.`);
|
|
51
|
+
else if (result.errored) this.error("Stylelint linting errors found in the listed files.");
|
|
52
|
+
else this.info("All files pass Stylelint linting.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.default = plugin;
|
|
60
|
+
exports.plugin = plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
import{getParentPath
|
|
1
|
+
import { getParentPath } from "@stryke/fs/get-parent-path";
|
|
2
|
+
import { appendPath } from "@stryke/path/append";
|
|
3
|
+
import { joinPaths } from "@stryke/path/join";
|
|
4
|
+
import { defu } from "defu";
|
|
5
|
+
import stylelint from "stylelint";
|
|
6
|
+
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* A Powerlines plugin to assist in linting stylesheets with Stylelint.
|
|
10
|
+
*/
|
|
11
|
+
function plugin(options = {}) {
|
|
12
|
+
return {
|
|
13
|
+
name: "stylelint",
|
|
14
|
+
async config() {
|
|
15
|
+
this.debug("Providing default configuration for the Powerlines `stylelint` build plugin.");
|
|
16
|
+
return { stylelint: defu(options, {
|
|
17
|
+
configFile: getParentPath([
|
|
18
|
+
"stylelint.config.js",
|
|
19
|
+
"stylelint.config.mjs",
|
|
20
|
+
"stylelint.config.cjs",
|
|
21
|
+
"stylelint.config.ts",
|
|
22
|
+
"stylelint.config.mts",
|
|
23
|
+
"stylelint.config.cts",
|
|
24
|
+
".stylelintrc.js",
|
|
25
|
+
".stylelintrc.cjs",
|
|
26
|
+
".stylelintrc.yaml",
|
|
27
|
+
".stylelintrc.yml",
|
|
28
|
+
".stylelintrc.json",
|
|
29
|
+
".stylelintrc"
|
|
30
|
+
], this.config.root, {
|
|
31
|
+
ignoreCase: true,
|
|
32
|
+
skipCwd: false,
|
|
33
|
+
includeNameInResults: true
|
|
34
|
+
}),
|
|
35
|
+
cwd: joinPaths(this.config.cwd, this.config.root),
|
|
36
|
+
silent: this.config.logLevel !== null,
|
|
37
|
+
fix: true
|
|
38
|
+
}) };
|
|
39
|
+
},
|
|
40
|
+
async lint() {
|
|
41
|
+
this.debug(`Linting project files with Stylelint.`);
|
|
42
|
+
const result = await stylelint.lint(options);
|
|
43
|
+
if (this.config.stylelint.outputFile) await this.fs.write(appendPath(this.config.stylelint.outputFile, this.config.root), result.report);
|
|
44
|
+
if (!this.config.stylelint.silent) {
|
|
45
|
+
this.info(result.report);
|
|
46
|
+
const totalWarnings = result.results.map((res) => res.warnings.filter((warn) => warn.severity === "warning")).reduce((prev, res) => prev + res.length, 0);
|
|
47
|
+
if (totalWarnings > 0) this.warn(`${totalWarnings} Stylelint linting warnings found in the listed files.`);
|
|
48
|
+
else if (result.errored) this.error("Stylelint linting errors found in the listed files.");
|
|
49
|
+
else this.info("All files pass Stylelint linting.");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { plugin as default, plugin };
|
|
2
57
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { defu } from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport stylelint from \"stylelint\";\nimport {\n StylelintPluginContext,\n StylelintPluginOptions,\n StylelintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n stylelint?: StylelintPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in linting stylesheets with Stylelint.\n */\nexport function plugin(\n options: StylelintPluginOptions = {}\n): Plugin<StylelintPluginContext> {\n return {\n name: \"stylelint\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `stylelint` build plugin.\"\n );\n\n const configFile = getParentPath(\n [\n \"stylelint.config.js\",\n \"stylelint.config.mjs\",\n \"stylelint.config.cjs\",\n \"stylelint.config.ts\",\n \"stylelint.config.mts\",\n \"stylelint.config.cts\",\n \".stylelintrc.js\",\n \".stylelintrc.cjs\",\n \".stylelintrc.yaml\",\n \".stylelintrc.yml\",\n \".stylelintrc.json\",\n \".stylelintrc\"\n ],\n this.config.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n stylelint: defu(options, {\n configFile,\n cwd: joinPaths(this.config.cwd, this.config.root),\n silent: this.config.logLevel !== null,\n fix: true\n })\n } as Partial<StylelintPluginResolvedConfig>;\n },\n async lint() {\n this.debug(`Linting project files with Stylelint.`);\n\n const result = await stylelint.lint(options);\n\n if (this.config.stylelint.outputFile) {\n await this.fs.write(\n appendPath(this.config.stylelint.outputFile, this.config.root),\n result.report\n );\n }\n\n if (!this.config.stylelint.silent) {\n this.info(result.report);\n\n const totalWarnings = result.results\n .map(res => res.warnings.filter(warn => warn.severity === \"warning\"))\n .reduce((prev, res) => prev + res.length, 0);\n if (totalWarnings > 0) {\n this.warn(\n `${totalWarnings} Stylelint linting warnings found in the listed files.`\n );\n } else if (result.errored) {\n this.error(\"Stylelint linting errors found in the listed files.\");\n } else {\n this.info(\"All files pass Stylelint linting.\");\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { defu } from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport stylelint from \"stylelint\";\nimport {\n StylelintPluginContext,\n StylelintPluginOptions,\n StylelintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n stylelint?: StylelintPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in linting stylesheets with Stylelint.\n */\nexport function plugin(\n options: StylelintPluginOptions = {}\n): Plugin<StylelintPluginContext> {\n return {\n name: \"stylelint\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `stylelint` build plugin.\"\n );\n\n const configFile = getParentPath(\n [\n \"stylelint.config.js\",\n \"stylelint.config.mjs\",\n \"stylelint.config.cjs\",\n \"stylelint.config.ts\",\n \"stylelint.config.mts\",\n \"stylelint.config.cts\",\n \".stylelintrc.js\",\n \".stylelintrc.cjs\",\n \".stylelintrc.yaml\",\n \".stylelintrc.yml\",\n \".stylelintrc.json\",\n \".stylelintrc\"\n ],\n this.config.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n stylelint: defu(options, {\n configFile,\n cwd: joinPaths(this.config.cwd, this.config.root),\n silent: this.config.logLevel !== null,\n fix: true\n })\n } as Partial<StylelintPluginResolvedConfig>;\n },\n async lint() {\n this.debug(`Linting project files with Stylelint.`);\n\n const result = await stylelint.lint(options);\n\n if (this.config.stylelint.outputFile) {\n await this.fs.write(\n appendPath(this.config.stylelint.outputFile, this.config.root),\n result.report\n );\n }\n\n if (!this.config.stylelint.silent) {\n this.info(result.report);\n\n const totalWarnings = result.results\n .map(res => res.warnings.filter(warn => warn.severity === \"warning\"))\n .reduce((prev, res) => prev + res.length, 0);\n if (totalWarnings > 0) {\n this.warn(\n `${totalWarnings} Stylelint linting warnings found in the listed files.`\n );\n } else if (result.errored) {\n this.error(\"Stylelint linting errors found in the listed files.\");\n } else {\n this.info(\"All files pass Stylelint linting.\");\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,UAAkC,EAAE,EACJ;AAChC,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,+EACD;AAyBD,UAAO,EACL,WAAW,KAAK,SAAS;IACvB,YAzBe,cACjB;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,EACD,KAAK,OAAO,MACZ;KACE,YAAY;KACZ,SAAS;KACT,sBAAsB;KACvB,CAKW;IACV,KAAK,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,KAAK;IACjD,QAAQ,KAAK,OAAO,aAAa;IACjC,KAAK;IACN,CAAC,EACH;;EAEH,MAAM,OAAO;AACX,QAAK,MAAM,wCAAwC;GAEnD,MAAM,SAAS,MAAM,UAAU,KAAK,QAAQ;AAE5C,OAAI,KAAK,OAAO,UAAU,WACxB,OAAM,KAAK,GAAG,MACZ,WAAW,KAAK,OAAO,UAAU,YAAY,KAAK,OAAO,KAAK,EAC9D,OAAO,OACR;AAGH,OAAI,CAAC,KAAK,OAAO,UAAU,QAAQ;AACjC,SAAK,KAAK,OAAO,OAAO;IAExB,MAAM,gBAAgB,OAAO,QAC1B,KAAI,QAAO,IAAI,SAAS,QAAO,SAAQ,KAAK,aAAa,UAAU,CAAC,CACpE,QAAQ,MAAM,QAAQ,OAAO,IAAI,QAAQ,EAAE;AAC9C,QAAI,gBAAgB,EAClB,MAAK,KACH,GAAG,cAAc,wDAClB;aACQ,OAAO,QAChB,MAAK,MAAM,sDAAsD;QAEjE,MAAK,KAAK,oCAAoC;;;EAIrD"}
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-stylelint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.462",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running Stylelint on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -95,16 +95,16 @@
|
|
|
95
95
|
"@stryke/fs": "^0.33.70",
|
|
96
96
|
"@stryke/path": "^0.28.2",
|
|
97
97
|
"defu": "^6.1.7",
|
|
98
|
-
"powerlines": "^0.46.
|
|
98
|
+
"powerlines": "^0.46.5",
|
|
99
99
|
"stylelint": "^16.26.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
102
|
+
"@powerlines/plugin-plugin": "^0.12.409",
|
|
103
103
|
"@types/node": "^25.6.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": { "access": "public" },
|
|
106
106
|
"main": "./dist/index.cjs",
|
|
107
107
|
"module": "./dist/index.mjs",
|
|
108
108
|
"types": "./dist/index.d.cts",
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
|
|
110
110
|
}
|