stylelint-webpack-plugin 3.0.1 → 3.1.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 +3 -3
- package/declarations/getStylelint.d.ts +47 -1
- package/declarations/linter.d.ts +47 -1
- package/declarations/options.d.ts +47 -1
- package/declarations/worker.d.ts +47 -1
- package/dist/linter.js +1 -1
- package/dist/utils.js +3 -1
- package/package.json +24 -23
package/README.md
CHANGED
|
@@ -125,21 +125,21 @@ You can still force this behavior by using `emitError` **or** `emitWarning` opti
|
|
|
125
125
|
#### `emitError`
|
|
126
126
|
|
|
127
127
|
- Type: `Boolean`
|
|
128
|
-
- Default: `
|
|
128
|
+
- Default: `true`
|
|
129
129
|
|
|
130
130
|
The errors found will always be emitted, to disable set to `false`.
|
|
131
131
|
|
|
132
132
|
#### `emitWarning`
|
|
133
133
|
|
|
134
134
|
- Type: `Boolean`
|
|
135
|
-
- Default: `
|
|
135
|
+
- Default: `true`
|
|
136
136
|
|
|
137
137
|
The warnings found will always be emitted, to disable set to `false`.
|
|
138
138
|
|
|
139
139
|
#### `failOnError`
|
|
140
140
|
|
|
141
141
|
- Type: `Boolean`
|
|
142
|
-
- Default: `
|
|
142
|
+
- Default: `true`
|
|
143
143
|
|
|
144
144
|
Will cause the module build to fail if there are any errors, to disable set to `false`.
|
|
145
145
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="stylelint" />
|
|
1
2
|
/**
|
|
2
3
|
* @param {string|undefined} key
|
|
3
4
|
* @param {Options} options
|
|
@@ -7,7 +8,52 @@ export default function getStylelint(
|
|
|
7
8
|
key: string | undefined,
|
|
8
9
|
{ threads, ...options }: Options
|
|
9
10
|
): Linter;
|
|
10
|
-
export type Stylelint =
|
|
11
|
+
export type Stylelint = import('postcss').PluginCreator<
|
|
12
|
+
import('stylelint').PostcssPluginOptions
|
|
13
|
+
> & {
|
|
14
|
+
lint: (
|
|
15
|
+
options: import('stylelint').LinterOptions
|
|
16
|
+
) => Promise<import('stylelint').LinterResult>;
|
|
17
|
+
rules: {
|
|
18
|
+
[k: string]: import('stylelint').Rule<any, any>;
|
|
19
|
+
};
|
|
20
|
+
formatters: {
|
|
21
|
+
[k: string]: import('stylelint').Formatter;
|
|
22
|
+
};
|
|
23
|
+
createPlugin: (
|
|
24
|
+
ruleName: string,
|
|
25
|
+
plugin: import('stylelint').Plugin<any, any>
|
|
26
|
+
) => {
|
|
27
|
+
ruleName: string;
|
|
28
|
+
rule: import('stylelint').Rule<any, any>;
|
|
29
|
+
};
|
|
30
|
+
createLinter: (
|
|
31
|
+
options: import('stylelint').LinterOptions
|
|
32
|
+
) => import('stylelint').InternalApi;
|
|
33
|
+
utils: {
|
|
34
|
+
report: (problem: import('stylelint').Problem) => void;
|
|
35
|
+
ruleMessages: <
|
|
36
|
+
T extends import('stylelint').RuleMessages,
|
|
37
|
+
R extends { [K in keyof T]: T[K] }
|
|
38
|
+
>(
|
|
39
|
+
ruleName: string,
|
|
40
|
+
messages: T
|
|
41
|
+
) => R;
|
|
42
|
+
validateOptions: (
|
|
43
|
+
result: import('stylelint').PostcssResult,
|
|
44
|
+
ruleName: string,
|
|
45
|
+
...optionDescriptions: import('stylelint').RuleOptions[]
|
|
46
|
+
) => boolean;
|
|
47
|
+
checkAgainstRule: <T_1, O extends Object>(
|
|
48
|
+
options: {
|
|
49
|
+
ruleName: string;
|
|
50
|
+
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
51
|
+
root: import('postcss').Root;
|
|
52
|
+
},
|
|
53
|
+
callback: (warning: import('postcss').Warning) => void
|
|
54
|
+
) => void;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
11
57
|
export type LintResult = import('stylelint').LintResult;
|
|
12
58
|
export type Options = import('./options').Options;
|
|
13
59
|
export type AsyncTask = () => Promise<void>;
|
package/declarations/linter.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="stylelint" />
|
|
1
2
|
/**
|
|
2
3
|
* @param {string|undefined} key
|
|
3
4
|
* @param {Options} options
|
|
@@ -13,7 +14,52 @@ export default function linter(
|
|
|
13
14
|
report: Reporter;
|
|
14
15
|
threads: number;
|
|
15
16
|
};
|
|
16
|
-
export type Stylelint =
|
|
17
|
+
export type Stylelint = import('postcss').PluginCreator<
|
|
18
|
+
import('stylelint').PostcssPluginOptions
|
|
19
|
+
> & {
|
|
20
|
+
lint: (
|
|
21
|
+
options: import('stylelint').LinterOptions
|
|
22
|
+
) => Promise<import('stylelint').LinterResult>;
|
|
23
|
+
rules: {
|
|
24
|
+
[k: string]: import('stylelint').Rule<any, any>;
|
|
25
|
+
};
|
|
26
|
+
formatters: {
|
|
27
|
+
[k: string]: import('stylelint').Formatter;
|
|
28
|
+
};
|
|
29
|
+
createPlugin: (
|
|
30
|
+
ruleName: string,
|
|
31
|
+
plugin: import('stylelint').Plugin<any, any>
|
|
32
|
+
) => {
|
|
33
|
+
ruleName: string;
|
|
34
|
+
rule: import('stylelint').Rule<any, any>;
|
|
35
|
+
};
|
|
36
|
+
createLinter: (
|
|
37
|
+
options: import('stylelint').LinterOptions
|
|
38
|
+
) => import('stylelint').InternalApi;
|
|
39
|
+
utils: {
|
|
40
|
+
report: (problem: import('stylelint').Problem) => void;
|
|
41
|
+
ruleMessages: <
|
|
42
|
+
T extends import('stylelint').RuleMessages,
|
|
43
|
+
R extends { [K in keyof T]: T[K] }
|
|
44
|
+
>(
|
|
45
|
+
ruleName: string,
|
|
46
|
+
messages: T
|
|
47
|
+
) => R;
|
|
48
|
+
validateOptions: (
|
|
49
|
+
result: import('stylelint').PostcssResult,
|
|
50
|
+
ruleName: string,
|
|
51
|
+
...optionDescriptions: import('stylelint').RuleOptions[]
|
|
52
|
+
) => boolean;
|
|
53
|
+
checkAgainstRule: <T_1, O extends Object>(
|
|
54
|
+
options: {
|
|
55
|
+
ruleName: string;
|
|
56
|
+
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
57
|
+
root: import('postcss').Root;
|
|
58
|
+
},
|
|
59
|
+
callback: (warning: import('postcss').Warning) => void
|
|
60
|
+
) => void;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
17
63
|
export type LintResult = import('stylelint').LintResult;
|
|
18
64
|
export type Compiler = import('webpack').Compiler;
|
|
19
65
|
export type Compilation = import('webpack').Compilation;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="stylelint" />
|
|
1
2
|
/** @typedef {import("stylelint")} stylelint */
|
|
2
3
|
/** @typedef {import("stylelint").LinterOptions} StylelintOptions */
|
|
3
4
|
/** @typedef {import("stylelint").FormatterType} FormatterType */
|
|
@@ -36,7 +37,52 @@ export function getOptions(pluginOptions: Options): Partial<PluginOptions>;
|
|
|
36
37
|
export function getStylelintOptions(
|
|
37
38
|
pluginOptions: Options
|
|
38
39
|
): Partial<StylelintOptions>;
|
|
39
|
-
export type stylelint =
|
|
40
|
+
export type stylelint = import('postcss').PluginCreator<
|
|
41
|
+
import('stylelint').PostcssPluginOptions
|
|
42
|
+
> & {
|
|
43
|
+
lint: (
|
|
44
|
+
options: import('stylelint').LinterOptions
|
|
45
|
+
) => Promise<import('stylelint').LinterResult>;
|
|
46
|
+
rules: {
|
|
47
|
+
[k: string]: import('stylelint').Rule<any, any>;
|
|
48
|
+
};
|
|
49
|
+
formatters: {
|
|
50
|
+
[k: string]: import('stylelint').Formatter;
|
|
51
|
+
};
|
|
52
|
+
createPlugin: (
|
|
53
|
+
ruleName: string,
|
|
54
|
+
plugin: import('stylelint').Plugin<any, any>
|
|
55
|
+
) => {
|
|
56
|
+
ruleName: string;
|
|
57
|
+
rule: import('stylelint').Rule<any, any>;
|
|
58
|
+
};
|
|
59
|
+
createLinter: (
|
|
60
|
+
options: import('stylelint').LinterOptions
|
|
61
|
+
) => import('stylelint').InternalApi;
|
|
62
|
+
utils: {
|
|
63
|
+
report: (problem: import('stylelint').Problem) => void;
|
|
64
|
+
ruleMessages: <
|
|
65
|
+
T extends import('stylelint').RuleMessages,
|
|
66
|
+
R extends { [K in keyof T]: T[K] }
|
|
67
|
+
>(
|
|
68
|
+
ruleName: string,
|
|
69
|
+
messages: T
|
|
70
|
+
) => R;
|
|
71
|
+
validateOptions: (
|
|
72
|
+
result: import('stylelint').PostcssResult,
|
|
73
|
+
ruleName: string,
|
|
74
|
+
...optionDescriptions: import('stylelint').RuleOptions[]
|
|
75
|
+
) => boolean;
|
|
76
|
+
checkAgainstRule: <T_1, O extends Object>(
|
|
77
|
+
options: {
|
|
78
|
+
ruleName: string;
|
|
79
|
+
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
80
|
+
root: import('postcss').Root;
|
|
81
|
+
},
|
|
82
|
+
callback: (warning: import('postcss').Warning) => void
|
|
83
|
+
) => void;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
40
86
|
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
41
87
|
export type FormatterType = import('stylelint').FormatterType;
|
|
42
88
|
export type OutputReport = {
|
package/declarations/worker.d.ts
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="stylelint" />
|
|
2
|
+
export type Stylelint = import('postcss').PluginCreator<
|
|
3
|
+
import('stylelint').PostcssPluginOptions
|
|
4
|
+
> & {
|
|
5
|
+
lint: (
|
|
6
|
+
options: import('stylelint').LinterOptions
|
|
7
|
+
) => Promise<import('stylelint').LinterResult>;
|
|
8
|
+
rules: {
|
|
9
|
+
[k: string]: import('stylelint').Rule<any, any>;
|
|
10
|
+
};
|
|
11
|
+
formatters: {
|
|
12
|
+
[k: string]: import('stylelint').Formatter;
|
|
13
|
+
};
|
|
14
|
+
createPlugin: (
|
|
15
|
+
ruleName: string,
|
|
16
|
+
plugin: import('stylelint').Plugin<any, any>
|
|
17
|
+
) => {
|
|
18
|
+
ruleName: string;
|
|
19
|
+
rule: import('stylelint').Rule<any, any>;
|
|
20
|
+
};
|
|
21
|
+
createLinter: (
|
|
22
|
+
options: import('stylelint').LinterOptions
|
|
23
|
+
) => import('stylelint').InternalApi;
|
|
24
|
+
utils: {
|
|
25
|
+
report: (problem: import('stylelint').Problem) => void;
|
|
26
|
+
ruleMessages: <
|
|
27
|
+
T extends import('stylelint').RuleMessages,
|
|
28
|
+
R extends { [K in keyof T]: T[K] }
|
|
29
|
+
>(
|
|
30
|
+
ruleName: string,
|
|
31
|
+
messages: T
|
|
32
|
+
) => R;
|
|
33
|
+
validateOptions: (
|
|
34
|
+
result: import('stylelint').PostcssResult,
|
|
35
|
+
ruleName: string,
|
|
36
|
+
...optionDescriptions: import('stylelint').RuleOptions[]
|
|
37
|
+
) => boolean;
|
|
38
|
+
checkAgainstRule: <T_1, O extends Object>(
|
|
39
|
+
options: {
|
|
40
|
+
ruleName: string;
|
|
41
|
+
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
42
|
+
root: import('postcss').Root;
|
|
43
|
+
},
|
|
44
|
+
callback: (warning: import('postcss').Warning) => void
|
|
45
|
+
) => void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
2
48
|
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
3
49
|
export type Options = import('./options').Options;
|
package/dist/linter.js
CHANGED
|
@@ -103,7 +103,7 @@ function linter(key, options, compilation) {
|
|
|
103
103
|
await cleanup();
|
|
104
104
|
|
|
105
105
|
for (const result of results) {
|
|
106
|
-
crossRunResultStorage[result.source] = result;
|
|
106
|
+
crossRunResultStorage[String(result.source)] = result;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
results = Object.values(crossRunResultStorage); // do not analyze if there are no results or stylelint config
|
package/dist/utils.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.arrify = arrify;
|
|
7
|
+
exports.jsonStringifyReplacerSortKeys = void 0;
|
|
7
8
|
exports.parseFiles = parseFiles;
|
|
8
9
|
exports.parseFoldersToGlobs = parseFoldersToGlobs;
|
|
9
|
-
exports.jsonStringifyReplacerSortKeys = void 0;
|
|
10
10
|
|
|
11
11
|
var _path = require("path");
|
|
12
12
|
|
|
@@ -33,6 +33,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
33
33
|
: [T]
|
|
34
34
|
}
|
|
35
35
|
*/
|
|
36
|
+
|
|
37
|
+
/* istanbul ignore next */
|
|
36
38
|
function arrify(value) {
|
|
37
39
|
// eslint-disable-next-line no-undefined
|
|
38
40
|
if (value === null || value === undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-webpack-plugin",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A Stylelint plugin for webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack-contrib/stylelint-webpack-plugin",
|
|
@@ -42,48 +42,49 @@
|
|
|
42
42
|
"declarations"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"stylelint": "^13.0.0",
|
|
45
|
+
"stylelint": "^13.0.0 || ^14.0.0",
|
|
46
46
|
"webpack": "^5.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@types/stylelint": "^13.13.
|
|
50
|
-
"jest-worker": "^27.0.6",
|
|
49
|
+
"@types/stylelint": "^13.13.3",
|
|
51
50
|
"globby": "^11.0.4",
|
|
51
|
+
"jest-worker": "^27.3.1",
|
|
52
52
|
"micromatch": "^4.0.4",
|
|
53
53
|
"normalize-path": "^3.0.0",
|
|
54
|
-
"schema-utils": "^3.1.
|
|
54
|
+
"schema-utils": "^3.1.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@babel/cli": "^7.
|
|
58
|
-
"@babel/core": "^7.
|
|
59
|
-
"@babel/preset-env": "^7.
|
|
60
|
-
"@commitlint/cli": "^
|
|
61
|
-
"@commitlint/config-conventional": "^
|
|
62
|
-
"@types/fs-extra": "^9.0.
|
|
57
|
+
"@babel/cli": "^7.16.0",
|
|
58
|
+
"@babel/core": "^7.16.0",
|
|
59
|
+
"@babel/preset-env": "^7.16.0",
|
|
60
|
+
"@commitlint/cli": "^14.1.0",
|
|
61
|
+
"@commitlint/config-conventional": "^14.1.0",
|
|
62
|
+
"@types/fs-extra": "^9.0.13",
|
|
63
63
|
"@types/micromatch": "^4.0.2",
|
|
64
64
|
"@types/normalize-path": "^3.0.0",
|
|
65
65
|
"@types/webpack": "^5.28.0",
|
|
66
66
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
67
67
|
"babel-eslint": "^10.1.0",
|
|
68
|
-
"babel-jest": "^27.
|
|
68
|
+
"babel-jest": "^27.3.1",
|
|
69
69
|
"chokidar": "^3.5.2",
|
|
70
70
|
"cross-env": "^7.0.3",
|
|
71
71
|
"del": "^6.0.0",
|
|
72
|
-
"del-cli": "^4.0.
|
|
73
|
-
"eslint": "^
|
|
72
|
+
"del-cli": "^4.0.1",
|
|
73
|
+
"eslint": "^8.1.0",
|
|
74
74
|
"eslint-config-prettier": "^8.3.0",
|
|
75
|
-
"eslint-plugin-import": "^2.
|
|
75
|
+
"eslint-plugin-import": "^2.25.2",
|
|
76
76
|
"file-loader": "^6.2.0",
|
|
77
77
|
"fs-extra": "^10.0.0",
|
|
78
|
-
"husky": "^7.0.
|
|
79
|
-
"jest": "^27.
|
|
80
|
-
"lint-staged": "^11.
|
|
78
|
+
"husky": "^7.0.4",
|
|
79
|
+
"jest": "^27.3.1",
|
|
80
|
+
"lint-staged": "^11.2.6",
|
|
81
81
|
"npm-run-all": "^4.1.5",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
82
|
+
"postcss-scss": "^4.0.2",
|
|
83
|
+
"prettier": "^2.4.1",
|
|
84
|
+
"standard-version": "^9.3.2",
|
|
85
|
+
"stylelint": "^14.0.1",
|
|
86
|
+
"typescript": "^4.4.4",
|
|
87
|
+
"webpack": "^5.61.0"
|
|
87
88
|
},
|
|
88
89
|
"keywords": [
|
|
89
90
|
"stylelint",
|