@powerlines/plugin-stylelint 0.1.293 → 0.1.295
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 +6 -6
- package/dist/index.d.cts +6 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +6 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +3 -9
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +3 -9
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ function plugin(options = {}) {
|
|
|
16
16
|
name: "stylelint",
|
|
17
17
|
async config() {
|
|
18
18
|
this.debug("Providing default configuration for the Powerlines `stylelint` build plugin.");
|
|
19
|
-
return {
|
|
19
|
+
return { stylelint: (0, defu.defu)(options, {
|
|
20
20
|
configFile: (0, __stryke_fs_get_parent_path.getParentPath)([
|
|
21
21
|
"stylelint.config.js",
|
|
22
22
|
"stylelint.config.mjs",
|
|
@@ -30,21 +30,21 @@ function plugin(options = {}) {
|
|
|
30
30
|
".stylelintrc.yml",
|
|
31
31
|
".stylelintrc.json",
|
|
32
32
|
".stylelintrc"
|
|
33
|
-
], this.config.
|
|
33
|
+
], this.config.root, {
|
|
34
34
|
ignoreCase: true,
|
|
35
35
|
skipCwd: false,
|
|
36
36
|
includeNameInResults: true
|
|
37
37
|
}),
|
|
38
|
-
cwd: (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.
|
|
38
|
+
cwd: (0, __stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root),
|
|
39
39
|
silent: this.config.logLevel !== null,
|
|
40
40
|
fix: true
|
|
41
|
-
}) }
|
|
41
|
+
}) };
|
|
42
42
|
},
|
|
43
43
|
async lint() {
|
|
44
44
|
this.debug(`Linting project files with Stylelint.`);
|
|
45
45
|
const result = await stylelint.default.lint(options);
|
|
46
|
-
if (this.config.
|
|
47
|
-
if (!this.config.
|
|
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
48
|
this.info(result.report);
|
|
49
49
|
const totalWarnings = result.results.map((res) => res.warnings.filter((warn) => warn.severity === "warning")).reduce((prev, res) => prev + res.length, 0);
|
|
50
50
|
if (totalWarnings > 0) this.warn(`${totalWarnings} Stylelint linting warnings found in the listed files.`);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
stylelint?: StylelintPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to assist in linting stylesheets with Stylelint.
|
|
9
13
|
*/
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA8BwB,SAAA,CAAA,EAIR,sBAJQ;EAAA;;;;AAWxB;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,sBAAA,CAAA,EACR,MADQ,CACD,sBADC,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
|
-
import { Plugin } from "powerlines
|
|
3
|
+
import { Plugin } from "powerlines";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
|
|
6
|
+
declare module "powerlines" {
|
|
7
|
+
interface UserConfig {
|
|
8
|
+
stylelint?: StylelintPluginOptions;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* A Powerlines plugin to assist in linting stylesheets with Stylelint.
|
|
9
13
|
*/
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IA8BwB,SAAA,CAAA,EAIR,sBAJQ;EAAA;;;;AAWxB;AACW,iBADK,MAAA,CACL,OAAA,CAAA,EAAA,sBAAA,CAAA,EACR,MADQ,CACD,sBADC,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ function plugin(options = {}) {
|
|
|
13
13
|
name: "stylelint",
|
|
14
14
|
async config() {
|
|
15
15
|
this.debug("Providing default configuration for the Powerlines `stylelint` build plugin.");
|
|
16
|
-
return {
|
|
16
|
+
return { stylelint: defu(options, {
|
|
17
17
|
configFile: getParentPath([
|
|
18
18
|
"stylelint.config.js",
|
|
19
19
|
"stylelint.config.mjs",
|
|
@@ -27,21 +27,21 @@ function plugin(options = {}) {
|
|
|
27
27
|
".stylelintrc.yml",
|
|
28
28
|
".stylelintrc.json",
|
|
29
29
|
".stylelintrc"
|
|
30
|
-
], this.config.
|
|
30
|
+
], this.config.root, {
|
|
31
31
|
ignoreCase: true,
|
|
32
32
|
skipCwd: false,
|
|
33
33
|
includeNameInResults: true
|
|
34
34
|
}),
|
|
35
|
-
cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.
|
|
35
|
+
cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.root),
|
|
36
36
|
silent: this.config.logLevel !== null,
|
|
37
37
|
fix: true
|
|
38
|
-
}) }
|
|
38
|
+
}) };
|
|
39
39
|
},
|
|
40
40
|
async lint() {
|
|
41
41
|
this.debug(`Linting project files with Stylelint.`);
|
|
42
42
|
const result = await stylelint.lint(options);
|
|
43
|
-
if (this.config.
|
|
44
|
-
if (!this.config.
|
|
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
45
|
this.info(result.report);
|
|
46
46
|
const totalWarnings = result.results.map((res) => res.warnings.filter((warn) => warn.severity === "warning")).reduce((prev, res) => prev + res.length, 0);
|
|
47
47
|
if (totalWarnings > 0) this.warn(`${totalWarnings} Stylelint linting warnings found in the listed files.`);
|
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
|
|
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 export interface UserConfig {\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.workspaceConfig.workspaceRoot, 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,CACF;IAKG,KAAK,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK;IACpE,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;;AAGH,kBAAe"}
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { UserConfig } from "powerlines
|
|
2
|
-
import { PluginContext } from "powerlines/types/context";
|
|
3
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
1
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
4
2
|
import { FixMode, LinterOptions } from "stylelint";
|
|
5
3
|
|
|
6
4
|
//#region src/types/plugin.d.ts
|
|
@@ -30,17 +28,13 @@ interface StylelintPluginUserConfig extends UserConfig {
|
|
|
30
28
|
/**
|
|
31
29
|
* Options for the Stylelint plugin.
|
|
32
30
|
*/
|
|
33
|
-
|
|
34
|
-
stylelint?: StylelintPluginOptions;
|
|
35
|
-
};
|
|
31
|
+
stylelint?: StylelintPluginOptions;
|
|
36
32
|
}
|
|
37
33
|
interface StylelintPluginResolvedConfig extends ResolvedConfig {
|
|
38
34
|
/**
|
|
39
35
|
* Options for the Stylelint plugin.
|
|
40
36
|
*/
|
|
41
|
-
|
|
42
|
-
stylelint: StylelintPluginOptions;
|
|
43
|
-
};
|
|
37
|
+
stylelint: StylelintPluginOptions;
|
|
44
38
|
}
|
|
45
39
|
type StylelintPluginContext<TResolvedConfig extends StylelintPluginResolvedConfig = StylelintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
46
40
|
declare type __ΩStylelintPluginOptions = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAqBiB,sBAAA,SAA+B,QAAQ;;AAAxD;;EAuBkB,UAAA,CAAA,EAAA,MAAA;EAvB8B;;AA0BhD;EAOiB,UAAA,CAAA,EAAA,MAAA;EAOL;;;;;EAGK,MAAA,CAAA,EAAA,OAAA;;;;;;kBApBC;;UAGD,yBAAA,SAAkC;;;;cAIrC;;UAGG,6BAAA,SAAsC;;;;aAI1C;;KAGD,+CACc,gCACtB,iCACA,cAAc"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { FixMode, LinterOptions } from "stylelint";
|
|
2
|
-
import { UserConfig } from "powerlines
|
|
3
|
-
import { PluginContext } from "powerlines/types/context";
|
|
4
|
-
import { ResolvedConfig } from "powerlines/types/resolved";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
5
3
|
|
|
6
4
|
//#region src/types/plugin.d.ts
|
|
7
5
|
interface StylelintPluginOptions extends Partial<LinterOptions> {
|
|
@@ -30,17 +28,13 @@ interface StylelintPluginUserConfig extends UserConfig {
|
|
|
30
28
|
/**
|
|
31
29
|
* Options for the Stylelint plugin.
|
|
32
30
|
*/
|
|
33
|
-
|
|
34
|
-
stylelint?: StylelintPluginOptions;
|
|
35
|
-
};
|
|
31
|
+
stylelint?: StylelintPluginOptions;
|
|
36
32
|
}
|
|
37
33
|
interface StylelintPluginResolvedConfig extends ResolvedConfig {
|
|
38
34
|
/**
|
|
39
35
|
* Options for the Stylelint plugin.
|
|
40
36
|
*/
|
|
41
|
-
|
|
42
|
-
stylelint: StylelintPluginOptions;
|
|
43
|
-
};
|
|
37
|
+
stylelint: StylelintPluginOptions;
|
|
44
38
|
}
|
|
45
39
|
type StylelintPluginContext<TResolvedConfig extends StylelintPluginResolvedConfig = StylelintPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
46
40
|
declare type __ΩStylelintPluginOptions = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;UAqBiB,sBAAA,SAA+B,QAAQ;;AAAxD;;EAuBkB,UAAA,CAAA,EAAA,MAAA;EAvB8B;;AA0BhD;EAOiB,UAAA,CAAA,EAAA,MAAA;EAOL;;;;;EAGK,MAAA,CAAA,EAAA,OAAA;;;;;;kBApBC;;UAGD,yBAAA,SAAkC;;;;cAIrC;;UAGG,6BAAA,SAAsC;;;;aAI1C;;KAGD,+CACc,gCACtB,iCACA,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-stylelint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.295",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running Stylelint on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"default": "./dist/index.mjs"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"
|
|
56
|
+
"./*": "./*",
|
|
57
57
|
"./types": {
|
|
58
58
|
"require": {
|
|
59
59
|
"types": "./dist/types/index.d.cts",
|
|
@@ -91,20 +91,20 @@
|
|
|
91
91
|
"powerlines-plugin"
|
|
92
92
|
],
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@storm-software/config-tools": "^1.189.
|
|
94
|
+
"@storm-software/config-tools": "^1.189.10",
|
|
95
95
|
"@stryke/fs": "^0.33.43",
|
|
96
96
|
"@stryke/path": "^0.26.6",
|
|
97
97
|
"defu": "^6.1.4",
|
|
98
|
-
"powerlines": "^0.
|
|
98
|
+
"powerlines": "^0.39.0",
|
|
99
99
|
"stylelint": "^16.26.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
103
|
-
"@types/node": "^25.3.
|
|
102
|
+
"@powerlines/plugin-plugin": "^0.12.242",
|
|
103
|
+
"@types/node": "^25.3.2"
|
|
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": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
|
|
110
110
|
}
|