stylelint-webpack-plugin 3.2.0 → 4.0.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/README.md +10 -7
- package/dist/StylelintError.js +1 -3
- package/dist/getStylelint.js +29 -38
- package/dist/index.js +40 -55
- package/dist/linter.js +78 -86
- package/dist/options.js +11 -14
- package/dist/options.json +1 -1
- package/dist/utils.js +13 -31
- package/dist/worker.js +9 -9
- package/package.json +29 -25
- package/types/getStylelint.d.ts +14 -3
- package/types/index.d.ts +9 -1
- package/types/linter.d.ts +20 -11
- package/types/options.d.ts +6 -1
- package/types/worker.d.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-webpack-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A Stylelint plugin for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/stylelint-webpack-plugin",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"types": "types/index.d.ts",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">= 14.15.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"start": "npm run build -- -w",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"security": "npm audit",
|
|
28
28
|
"lint:prettier": "prettier -w --list-different .",
|
|
29
29
|
"lint:js": "eslint --cache .",
|
|
30
|
+
"lint:spelling": "cspell \"**/*.*\"",
|
|
30
31
|
"lint:types": "tsc --pretty --noEmit",
|
|
31
32
|
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
32
33
|
"test:only": "cross-env NODE_ENV=test jest --testTimeout=60000",
|
|
@@ -46,44 +47,47 @@
|
|
|
46
47
|
"webpack": "^5.0.0"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"jest-worker": "^27.5.1",
|
|
50
50
|
"globby": "^11.1.0",
|
|
51
|
-
"
|
|
51
|
+
"jest-worker": "^29.4.1",
|
|
52
|
+
"micromatch": "^4.0.5",
|
|
52
53
|
"normalize-path": "^3.0.0",
|
|
53
54
|
"schema-utils": "^4.0.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@babel/cli": "^7.
|
|
57
|
-
"@babel/core": "^7.
|
|
58
|
-
"@babel/preset-env": "^7.
|
|
59
|
-
"@commitlint/cli": "^
|
|
60
|
-
"@commitlint/config-conventional": "^
|
|
57
|
+
"@babel/cli": "^7.20.7",
|
|
58
|
+
"@babel/core": "^7.20.12",
|
|
59
|
+
"@babel/preset-env": "^7.20.2",
|
|
60
|
+
"@commitlint/cli": "^17.4.2",
|
|
61
|
+
"@commitlint/config-conventional": "^17.4.2",
|
|
62
|
+
"@types/file-entry-cache": "^5.0.2",
|
|
61
63
|
"@types/fs-extra": "^9.0.13",
|
|
62
64
|
"@types/micromatch": "^4.0.2",
|
|
65
|
+
"@types/node": "^18.11.18",
|
|
63
66
|
"@types/normalize-path": "^3.0.0",
|
|
64
67
|
"@types/webpack": "^5.28.0",
|
|
65
68
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
66
69
|
"babel-eslint": "^10.1.0",
|
|
67
|
-
"babel-jest": "^
|
|
68
|
-
"chokidar": "^3.5.
|
|
70
|
+
"babel-jest": "^29.4.1",
|
|
71
|
+
"chokidar": "^3.5.3",
|
|
69
72
|
"cross-env": "^7.0.3",
|
|
70
|
-
"
|
|
73
|
+
"cspell": "^6.20.1",
|
|
74
|
+
"del": "^6.1.1",
|
|
71
75
|
"del-cli": "^4.0.1",
|
|
72
|
-
"eslint": "^8.
|
|
73
|
-
"eslint-config-prettier": "^8.
|
|
74
|
-
"eslint-plugin-import": "^2.
|
|
76
|
+
"eslint": "^8.33.0",
|
|
77
|
+
"eslint-config-prettier": "^8.6.0",
|
|
78
|
+
"eslint-plugin-import": "^2.27.5",
|
|
75
79
|
"file-loader": "^6.2.0",
|
|
76
|
-
"fs-extra": "^10.0
|
|
77
|
-
"husky": "^
|
|
78
|
-
"jest": "^
|
|
79
|
-
"lint-staged": "^
|
|
80
|
+
"fs-extra": "^10.1.0",
|
|
81
|
+
"husky": "^8.0.3",
|
|
82
|
+
"jest": "^29.4.1",
|
|
83
|
+
"lint-staged": "^13.1.0",
|
|
80
84
|
"npm-run-all": "^4.1.5",
|
|
81
|
-
"postcss-scss": "^4.0.
|
|
82
|
-
"prettier": "^2.
|
|
83
|
-
"standard-version": "^9.
|
|
84
|
-
"stylelint": "^14.
|
|
85
|
-
"typescript": "^4.
|
|
86
|
-
"webpack": "^5.
|
|
85
|
+
"postcss-scss": "^4.0.6",
|
|
86
|
+
"prettier": "^2.8.3",
|
|
87
|
+
"standard-version": "^9.5.0",
|
|
88
|
+
"stylelint": "^14.16.1",
|
|
89
|
+
"typescript": "^4.9.5",
|
|
90
|
+
"webpack": "^5.75.0"
|
|
87
91
|
},
|
|
88
92
|
"keywords": [
|
|
89
93
|
"stylelint",
|
package/types/getStylelint.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ declare namespace getStylelint {
|
|
|
14
14
|
Stylelint,
|
|
15
15
|
LintResult,
|
|
16
16
|
Options,
|
|
17
|
+
isPathIgnored,
|
|
17
18
|
AsyncTask,
|
|
18
19
|
LintTask,
|
|
19
20
|
Linter,
|
|
@@ -22,8 +23,8 @@ declare namespace getStylelint {
|
|
|
22
23
|
}
|
|
23
24
|
type Options = import('./options').Options;
|
|
24
25
|
type Linter = {
|
|
25
|
-
api: import('stylelint').InternalApi;
|
|
26
26
|
stylelint: Stylelint;
|
|
27
|
+
isPathIgnored: isPathIgnored;
|
|
27
28
|
lintFiles: LintTask;
|
|
28
29
|
cleanup: AsyncTask;
|
|
29
30
|
threads: number;
|
|
@@ -42,7 +43,7 @@ type Stylelint = import('postcss').PluginCreator<
|
|
|
42
43
|
};
|
|
43
44
|
createPlugin: (
|
|
44
45
|
ruleName: string,
|
|
45
|
-
|
|
46
|
+
rule: import('stylelint').Rule<any, any>
|
|
46
47
|
) => {
|
|
47
48
|
ruleName: string;
|
|
48
49
|
rule: import('stylelint').Rule<any, any>;
|
|
@@ -78,14 +79,24 @@ type Stylelint = import('postcss').PluginCreator<
|
|
|
78
79
|
ruleName: string;
|
|
79
80
|
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
80
81
|
root: import('postcss').Root;
|
|
82
|
+
result?: import('stylelint').PostcssResult | undefined;
|
|
83
|
+
context?: import('stylelint').RuleContext | undefined;
|
|
81
84
|
},
|
|
82
85
|
callback: (warning: import('postcss').Warning) => void
|
|
83
86
|
) => void;
|
|
84
87
|
};
|
|
88
|
+
reference: {
|
|
89
|
+
longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
|
|
90
|
+
};
|
|
85
91
|
};
|
|
86
92
|
type LintResult = import('stylelint').LintResult;
|
|
93
|
+
type isPathIgnored = (
|
|
94
|
+
stylelint: Stylelint,
|
|
95
|
+
filePath: string
|
|
96
|
+
) => Promise<boolean>;
|
|
87
97
|
type AsyncTask = () => Promise<void>;
|
|
88
98
|
type LintTask = (files: string | string[]) => Promise<LintResult[]>;
|
|
89
|
-
type Worker =
|
|
99
|
+
type Worker = JestWorker & {
|
|
90
100
|
lintFiles: LintTask;
|
|
91
101
|
};
|
|
102
|
+
import { Worker as JestWorker } from 'jest-worker';
|
package/types/index.d.ts
CHANGED
|
@@ -8,8 +8,16 @@ declare class StylelintWebpackPlugin {
|
|
|
8
8
|
options: Partial<import('./options').PluginOptions>;
|
|
9
9
|
/**
|
|
10
10
|
* @param {Compiler} compiler
|
|
11
|
+
* @param {Options} options
|
|
12
|
+
* @param {string[]} wanted
|
|
13
|
+
* @param {string[]} exclude
|
|
11
14
|
*/
|
|
12
|
-
run(
|
|
15
|
+
run(
|
|
16
|
+
compiler: Compiler,
|
|
17
|
+
options: Options,
|
|
18
|
+
wanted: string[],
|
|
19
|
+
exclude: string[]
|
|
20
|
+
): Promise<void>;
|
|
13
21
|
startTime: number;
|
|
14
22
|
prevTimestamps: Map<any, any>;
|
|
15
23
|
/**
|
package/types/linter.d.ts
CHANGED
|
@@ -4,14 +4,15 @@ export = linter;
|
|
|
4
4
|
* @param {string|undefined} key
|
|
5
5
|
* @param {Options} options
|
|
6
6
|
* @param {Compilation} compilation
|
|
7
|
-
* @returns {{
|
|
7
|
+
* @returns {{stylelint: Stylelint, isPathIgnored: isPathIgnored, lint: Linter, report: Reporter, threads: number}}
|
|
8
8
|
*/
|
|
9
9
|
declare function linter(
|
|
10
10
|
key: string | undefined,
|
|
11
11
|
options: Options,
|
|
12
12
|
compilation: Compilation
|
|
13
13
|
): {
|
|
14
|
-
|
|
14
|
+
stylelint: Stylelint;
|
|
15
|
+
isPathIgnored: getStylelint.isPathIgnored;
|
|
15
16
|
lint: Linter;
|
|
16
17
|
report: Reporter;
|
|
17
18
|
threads: number;
|
|
@@ -20,12 +21,13 @@ declare namespace linter {
|
|
|
20
21
|
export {
|
|
21
22
|
Stylelint,
|
|
22
23
|
LintResult,
|
|
23
|
-
|
|
24
|
+
LinterResult,
|
|
25
|
+
Formatter,
|
|
26
|
+
FormatterType,
|
|
24
27
|
Compiler,
|
|
25
28
|
Compilation,
|
|
26
29
|
Options,
|
|
27
|
-
|
|
28
|
-
FormatterFunction,
|
|
30
|
+
isPathIgnored,
|
|
29
31
|
GenerateReport,
|
|
30
32
|
Report,
|
|
31
33
|
Reporter,
|
|
@@ -35,9 +37,6 @@ declare namespace linter {
|
|
|
35
37
|
}
|
|
36
38
|
type Options = import('./options').Options;
|
|
37
39
|
type Compilation = import('webpack').Compilation;
|
|
38
|
-
type InternalApi = import('stylelint').InternalApi;
|
|
39
|
-
type Linter = (files: string | string[]) => void;
|
|
40
|
-
type Reporter = () => Promise<Report>;
|
|
41
40
|
type Stylelint = import('postcss').PluginCreator<
|
|
42
41
|
import('stylelint').PostcssPluginOptions
|
|
43
42
|
> & {
|
|
@@ -52,7 +51,7 @@ type Stylelint = import('postcss').PluginCreator<
|
|
|
52
51
|
};
|
|
53
52
|
createPlugin: (
|
|
54
53
|
ruleName: string,
|
|
55
|
-
|
|
54
|
+
rule: import('stylelint').Rule<any, any>
|
|
56
55
|
) => {
|
|
57
56
|
ruleName: string;
|
|
58
57
|
rule: import('stylelint').Rule<any, any>;
|
|
@@ -88,15 +87,25 @@ type Stylelint = import('postcss').PluginCreator<
|
|
|
88
87
|
ruleName: string;
|
|
89
88
|
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
90
89
|
root: import('postcss').Root;
|
|
90
|
+
result?: import('stylelint').PostcssResult | undefined;
|
|
91
|
+
context?: import('stylelint').RuleContext | undefined;
|
|
91
92
|
},
|
|
92
93
|
callback: (warning: import('postcss').Warning) => void
|
|
93
94
|
) => void;
|
|
94
95
|
};
|
|
96
|
+
reference: {
|
|
97
|
+
longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
|
|
98
|
+
};
|
|
95
99
|
};
|
|
100
|
+
type Linter = (files: string | string[]) => void;
|
|
101
|
+
type Reporter = () => Promise<Report>;
|
|
102
|
+
import getStylelint = require('./getStylelint');
|
|
96
103
|
type LintResult = import('stylelint').LintResult;
|
|
104
|
+
type LinterResult = import('stylelint').LinterResult;
|
|
105
|
+
type Formatter = import('stylelint').Formatter;
|
|
106
|
+
type FormatterType = import('stylelint').FormatterType;
|
|
97
107
|
type Compiler = import('webpack').Compiler;
|
|
98
|
-
type
|
|
99
|
-
type FormatterFunction = (results: LintResult[]) => string;
|
|
108
|
+
type isPathIgnored = import('./getStylelint').isPathIgnored;
|
|
100
109
|
type GenerateReport = (compilation: Compilation) => Promise<void>;
|
|
101
110
|
type Report = {
|
|
102
111
|
errors?: StylelintError;
|
package/types/options.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type stylelint = import('postcss').PluginCreator<
|
|
|
13
13
|
};
|
|
14
14
|
createPlugin: (
|
|
15
15
|
ruleName: string,
|
|
16
|
-
|
|
16
|
+
rule: import('stylelint').Rule<any, any>
|
|
17
17
|
) => {
|
|
18
18
|
ruleName: string;
|
|
19
19
|
rule: import('stylelint').Rule<any, any>;
|
|
@@ -49,10 +49,15 @@ export type stylelint = import('postcss').PluginCreator<
|
|
|
49
49
|
ruleName: string;
|
|
50
50
|
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
51
51
|
root: import('postcss').Root;
|
|
52
|
+
result?: import('stylelint').PostcssResult | undefined;
|
|
53
|
+
context?: import('stylelint').RuleContext | undefined;
|
|
52
54
|
},
|
|
53
55
|
callback: (warning: import('postcss').Warning) => void
|
|
54
56
|
) => void;
|
|
55
57
|
};
|
|
58
|
+
reference: {
|
|
59
|
+
longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
|
|
60
|
+
};
|
|
56
61
|
};
|
|
57
62
|
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
58
63
|
export type FormatterType = import('stylelint').FormatterType;
|
package/types/worker.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type Stylelint = import('postcss').PluginCreator<
|
|
|
13
13
|
};
|
|
14
14
|
createPlugin: (
|
|
15
15
|
ruleName: string,
|
|
16
|
-
|
|
16
|
+
rule: import('stylelint').Rule<any, any>
|
|
17
17
|
) => {
|
|
18
18
|
ruleName: string;
|
|
19
19
|
rule: import('stylelint').Rule<any, any>;
|
|
@@ -49,10 +49,15 @@ export type Stylelint = import('postcss').PluginCreator<
|
|
|
49
49
|
ruleName: string;
|
|
50
50
|
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
51
51
|
root: import('postcss').Root;
|
|
52
|
+
result?: import('stylelint').PostcssResult | undefined;
|
|
53
|
+
context?: import('stylelint').RuleContext | undefined;
|
|
52
54
|
},
|
|
53
55
|
callback: (warning: import('postcss').Warning) => void
|
|
54
56
|
) => void;
|
|
55
57
|
};
|
|
58
|
+
reference: {
|
|
59
|
+
longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
|
|
60
|
+
};
|
|
56
61
|
};
|
|
57
62
|
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
58
63
|
export type Options = import('./options').Options;
|