stylelint-webpack-plugin 4.1.1 → 5.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 +4 -4
- package/dist/getStylelint.js +1 -16
- package/dist/index.js +2 -16
- package/dist/linter.js +6 -13
- package/dist/options.json +5 -1
- package/dist/worker.js +2 -1
- package/package.json +35 -32
- package/types/getStylelint.d.ts +1 -7
- package/types/index.d.ts +2 -2
- package/types/linter.d.ts +3 -8
- package/types/options.d.ts +1 -1
- package/types/utils.d.ts +8 -8
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[![node][node]][node-url]
|
|
8
8
|
[![tests][tests]][tests-url]
|
|
9
9
|
[![coverage][cover]][cover-url]
|
|
10
|
-
[![
|
|
10
|
+
[![discussion][discussion]][discussion-url]
|
|
11
11
|
[![size][size]][size-url]
|
|
12
12
|
|
|
13
13
|
# stylelint-webpack-plugin
|
|
14
14
|
|
|
15
|
-
> This
|
|
15
|
+
> This version of stylelint-webpack-plugin only works with webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/stylelint-webpack-plugin/tree/2.x).
|
|
16
16
|
|
|
17
17
|
This plugin uses [`stylelint`](https://stylelint.io/) that helps you avoid errors and enforce conventions in your styles.
|
|
18
18
|
|
|
@@ -338,7 +338,7 @@ You can pass in a different formatter for the output file, if none is passed in
|
|
|
338
338
|
[tests-url]: https://github.com/webpack-contrib/stylelint-webpack-plugin/actions
|
|
339
339
|
[cover]: https://codecov.io/gh/webpack-contrib/stylelint-webpack-plugin/branch/master/graph/badge.svg
|
|
340
340
|
[cover-url]: https://codecov.io/gh/webpack-contrib/stylelint-webpack-plugin
|
|
341
|
-
[
|
|
342
|
-
[
|
|
341
|
+
[discussion]: https://img.shields.io/github/discussions/webpack/webpack
|
|
342
|
+
[discussion-url]: https://github.com/webpack/webpack/discussions
|
|
343
343
|
[size]: https://packagephobia.now.sh/badge?p=stylelint-webpack-plugin
|
|
344
344
|
[size-url]: https://packagephobia.now.sh/result?p=stylelint-webpack-plugin
|
package/dist/getStylelint.js
CHANGED
|
@@ -29,10 +29,9 @@ const cache = {};
|
|
|
29
29
|
/** @typedef {import('stylelint').Formatter} Formatter */
|
|
30
30
|
/** @typedef {import('stylelint').FormatterType} FormatterType */
|
|
31
31
|
/** @typedef {import('./options').Options} Options */
|
|
32
|
-
/** @typedef {(stylelint: Stylelint, filePath: string) => Promise<boolean>} isPathIgnored */
|
|
33
32
|
/** @typedef {() => Promise<void>} AsyncTask */
|
|
34
33
|
/** @typedef {(files: string|string[]) => Promise<LintResult[]>} LintTask */
|
|
35
|
-
/** @typedef {{stylelint: Stylelint,
|
|
34
|
+
/** @typedef {{stylelint: Stylelint, lintFiles: LintTask, cleanup: AsyncTask, threads: number }} Linter */
|
|
36
35
|
/** @typedef {JestWorker & {lintFiles: LintTask}} Worker */
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -42,22 +41,8 @@ const cache = {};
|
|
|
42
41
|
function loadStylelint(options) {
|
|
43
42
|
const stylelintOptions = getStylelintOptions(options);
|
|
44
43
|
const stylelint = setup(options, stylelintOptions);
|
|
45
|
-
|
|
46
|
-
/** @type {isPathIgnored} */
|
|
47
|
-
let isPathIgnored;
|
|
48
|
-
try {
|
|
49
|
-
isPathIgnored = require(`${options.stylelintPath}/lib/isPathIgnored`);
|
|
50
|
-
} catch (e) {
|
|
51
|
-
try {
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
isPathIgnored = require('stylelint/lib/isPathIgnored');
|
|
54
|
-
} catch (_) {
|
|
55
|
-
isPathIgnored = () => Promise.resolve(false);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
44
|
return {
|
|
59
45
|
stylelint,
|
|
60
|
-
isPathIgnored,
|
|
61
46
|
lintFiles,
|
|
62
47
|
cleanup: async () => {},
|
|
63
48
|
threads: 1
|
package/dist/index.js
CHANGED
|
@@ -89,15 +89,9 @@ class StylelintWebpackPlugin {
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
compiler.hooks.thisCompilation.tap(this.key, compilation => {
|
|
92
|
-
/** @type {import('./getStylelint').Stylelint} */
|
|
93
|
-
let stylelint;
|
|
94
|
-
|
|
95
92
|
/** @type {import('./linter').Linter} */
|
|
96
93
|
let lint;
|
|
97
94
|
|
|
98
|
-
/** @type {import('./linter').isPathIgnored} */
|
|
99
|
-
let isPathIgnored;
|
|
100
|
-
|
|
101
95
|
/** @type {import('./linter').Reporter} */
|
|
102
96
|
let report;
|
|
103
97
|
|
|
@@ -105,9 +99,7 @@ class StylelintWebpackPlugin {
|
|
|
105
99
|
let threads;
|
|
106
100
|
try {
|
|
107
101
|
({
|
|
108
|
-
stylelint,
|
|
109
102
|
lint,
|
|
110
|
-
isPathIgnored,
|
|
111
103
|
report,
|
|
112
104
|
threads
|
|
113
105
|
} = linter(this.key, options, compilation));
|
|
@@ -118,20 +110,14 @@ class StylelintWebpackPlugin {
|
|
|
118
110
|
compilation.hooks.finishModules.tapPromise(this.key, async () => {
|
|
119
111
|
/** @type {string[]} */
|
|
120
112
|
// @ts-ignore
|
|
121
|
-
const files =
|
|
113
|
+
const files = compiler.modifiedFiles ? Array.from(compiler.modifiedFiles).filter(file => isMatch(file, wanted, {
|
|
122
114
|
dot: true
|
|
123
115
|
}) && !isMatch(file, exclude, {
|
|
124
116
|
dot: true
|
|
125
117
|
})) : globby.sync(wanted, {
|
|
126
118
|
dot: true,
|
|
127
119
|
ignore: exclude
|
|
128
|
-
})
|
|
129
|
-
try {
|
|
130
|
-
return (await isPathIgnored(stylelint, file)) ? false : file;
|
|
131
|
-
} catch (e) {
|
|
132
|
-
return file;
|
|
133
|
-
}
|
|
134
|
-
}))).filter(file => file !== false);
|
|
120
|
+
});
|
|
135
121
|
if (threads > 1) {
|
|
136
122
|
for (const file of files) {
|
|
137
123
|
lint(parseFiles(file, String(options.context)));
|
package/dist/linter.js
CHANGED
|
@@ -18,7 +18,6 @@ const {
|
|
|
18
18
|
/** @typedef {import('./getStylelint').LinterResult} LinterResult */
|
|
19
19
|
/** @typedef {import('./getStylelint').Formatter} Formatter */
|
|
20
20
|
/** @typedef {import('./getStylelint').FormatterType} FormatterType */
|
|
21
|
-
/** @typedef {import('./getStylelint').isPathIgnored} isPathIgnored */
|
|
22
21
|
/** @typedef {import('./options').Options} Options */
|
|
23
22
|
/** @typedef {(compilation: Compilation) => Promise<void>} GenerateReport */
|
|
24
23
|
/** @typedef {{errors?: StylelintError, warnings?: StylelintError, generateReportAsset?: GenerateReport}} Report */
|
|
@@ -33,15 +32,12 @@ const resultStorage = new WeakMap();
|
|
|
33
32
|
* @param {string|undefined} key
|
|
34
33
|
* @param {Options} options
|
|
35
34
|
* @param {Compilation} compilation
|
|
36
|
-
* @returns {{
|
|
35
|
+
* @returns {{lint: Linter, report: Reporter, threads: number}}
|
|
37
36
|
*/
|
|
38
37
|
function linter(key, options, compilation) {
|
|
39
38
|
/** @type {Stylelint} */
|
|
40
39
|
let stylelint;
|
|
41
40
|
|
|
42
|
-
/** @type {isPathIgnored} */
|
|
43
|
-
let isPathIgnored;
|
|
44
|
-
|
|
45
41
|
/** @type {(files: string|string[]) => Promise<LintResult[]>} */
|
|
46
42
|
let lintFiles;
|
|
47
43
|
|
|
@@ -57,7 +53,6 @@ function linter(key, options, compilation) {
|
|
|
57
53
|
try {
|
|
58
54
|
({
|
|
59
55
|
stylelint,
|
|
60
|
-
isPathIgnored,
|
|
61
56
|
lintFiles,
|
|
62
57
|
cleanup,
|
|
63
58
|
threads
|
|
@@ -66,9 +61,7 @@ function linter(key, options, compilation) {
|
|
|
66
61
|
throw new StylelintError(e.message);
|
|
67
62
|
}
|
|
68
63
|
return {
|
|
69
|
-
stylelint,
|
|
70
64
|
lint,
|
|
71
|
-
isPathIgnored,
|
|
72
65
|
report,
|
|
73
66
|
threads
|
|
74
67
|
};
|
|
@@ -101,7 +94,7 @@ function linter(key, options, compilation) {
|
|
|
101
94
|
if (!results || results.length < 1) {
|
|
102
95
|
return {};
|
|
103
96
|
}
|
|
104
|
-
const formatter = loadFormatter(stylelint, options.formatter);
|
|
97
|
+
const formatter = await loadFormatter(stylelint, options.formatter);
|
|
105
98
|
|
|
106
99
|
/** @type {LinterResult} */
|
|
107
100
|
const returnValue = {
|
|
@@ -137,7 +130,7 @@ function linter(key, options, compilation) {
|
|
|
137
130
|
* @param {string} name
|
|
138
131
|
* @param {string | Buffer} content
|
|
139
132
|
*/
|
|
140
|
-
const save = (name, content) => /** @type {Promise<void>} */
|
|
133
|
+
const save = (name, content) => ( /** @type {Promise<void>} */
|
|
141
134
|
new Promise((finish, bail) => {
|
|
142
135
|
const {
|
|
143
136
|
mkdir,
|
|
@@ -154,12 +147,12 @@ function linter(key, options, compilation) {
|
|
|
154
147
|
if (err2) bail(err2);else finish();
|
|
155
148
|
});
|
|
156
149
|
});
|
|
157
|
-
});
|
|
150
|
+
}));
|
|
158
151
|
if (!outputReport || !outputReport.filePath) {
|
|
159
152
|
return;
|
|
160
153
|
}
|
|
161
154
|
const content = outputReport.formatter;
|
|
162
|
-
loadFormatter(stylelint, outputReport.formatter)(results, returnValue);
|
|
155
|
+
(await loadFormatter(stylelint, outputReport.formatter))(results, returnValue);
|
|
163
156
|
formatter(results, returnValue);
|
|
164
157
|
let {
|
|
165
158
|
filePath
|
|
@@ -229,7 +222,7 @@ function parseResults(options, results) {
|
|
|
229
222
|
/**
|
|
230
223
|
* @param {Stylelint} stylelint
|
|
231
224
|
* @param {FormatterType=} formatter
|
|
232
|
-
* @returns {Formatter}
|
|
225
|
+
* @returns {Promise<Formatter>|Formatter}
|
|
233
226
|
*/
|
|
234
227
|
function loadFormatter(stylelint, formatter) {
|
|
235
228
|
if (typeof formatter === 'function') {
|
package/dist/options.json
CHANGED
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"formatter": {
|
|
38
38
|
"description": "Specify the formatter that you would like to use to format your results.",
|
|
39
|
-
"anyOf": [
|
|
39
|
+
"anyOf": [
|
|
40
|
+
{ "type": "string" },
|
|
41
|
+
{ "instanceof": "Function" },
|
|
42
|
+
{ "instanceof": "Promise" }
|
|
43
|
+
]
|
|
40
44
|
},
|
|
41
45
|
"lintDirtyModulesOnly": {
|
|
42
46
|
"description": "Lint only changed files, skip lint on start.",
|
package/dist/worker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stylelint-webpack-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.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": ">= 18.12.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"start": "npm run build -- -w",
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
"lint:spelling": "cspell \"**/*.*\"",
|
|
31
31
|
"lint:types": "tsc --pretty --noEmit",
|
|
32
32
|
"lint": "npm-run-all -l -p \"lint:**\"",
|
|
33
|
-
"
|
|
33
|
+
"fix:js": "npm run lint:js -- --fix",
|
|
34
|
+
"fix:prettier": "npm run lint:prettier -- --write",
|
|
35
|
+
"fix": "npm-run-all -l fix:js fix:prettier",
|
|
36
|
+
"test:only": "cross-env NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest --testTimeout=60000",
|
|
34
37
|
"test:watch": "npm run test:only -- --watch",
|
|
35
38
|
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
|
|
36
39
|
"pretest": "npm run lint",
|
|
@@ -43,51 +46,51 @@
|
|
|
43
46
|
"types"
|
|
44
47
|
],
|
|
45
48
|
"peerDependencies": {
|
|
46
|
-
"stylelint": "^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
49
|
+
"stylelint": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
47
50
|
"webpack": "^5.0.0"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
53
|
"globby": "^11.1.0",
|
|
51
|
-
"jest-worker": "^29.
|
|
54
|
+
"jest-worker": "^29.7.0",
|
|
52
55
|
"micromatch": "^4.0.5",
|
|
53
56
|
"normalize-path": "^3.0.0",
|
|
54
|
-
"schema-utils": "^4.
|
|
57
|
+
"schema-utils": "^4.2.0"
|
|
55
58
|
},
|
|
56
59
|
"devDependencies": {
|
|
57
|
-
"@babel/cli": "^7.
|
|
58
|
-
"@babel/core": "^7.
|
|
59
|
-
"@babel/preset-env": "^7.
|
|
60
|
-
"@commitlint/cli": "^
|
|
61
|
-
"@commitlint/config-conventional": "^
|
|
62
|
-
"@types/file-entry-cache": "^5.0.
|
|
63
|
-
"@types/fs-extra": "^
|
|
64
|
-
"@types/micromatch": "^4.0.
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"@types/normalize-path": "^3.0.
|
|
67
|
-
"@types/webpack": "^5.28.
|
|
60
|
+
"@babel/cli": "^7.23.4",
|
|
61
|
+
"@babel/core": "^7.23.7",
|
|
62
|
+
"@babel/preset-env": "^7.23.8",
|
|
63
|
+
"@commitlint/cli": "^18.6.0",
|
|
64
|
+
"@commitlint/config-conventional": "^18.6.0",
|
|
65
|
+
"@types/file-entry-cache": "^5.0.4",
|
|
66
|
+
"@types/fs-extra": "^11.0.4",
|
|
67
|
+
"@types/micromatch": "^4.0.6",
|
|
68
|
+
"@types/node": "^20.11.6",
|
|
69
|
+
"@types/normalize-path": "^3.0.2",
|
|
70
|
+
"@types/webpack": "^5.28.5",
|
|
68
71
|
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
|
|
69
72
|
"babel-eslint": "^10.1.0",
|
|
70
|
-
"babel-jest": "^29.
|
|
73
|
+
"babel-jest": "^29.7.0",
|
|
71
74
|
"chokidar": "^3.5.3",
|
|
72
75
|
"cross-env": "^7.0.3",
|
|
73
|
-
"cspell": "^
|
|
74
|
-
"del": "^
|
|
75
|
-
"del-cli": "^
|
|
76
|
-
"eslint": "^8.
|
|
77
|
-
"eslint-config-prettier": "^
|
|
78
|
-
"eslint-plugin-import": "^2.
|
|
76
|
+
"cspell": "^8.3.2",
|
|
77
|
+
"del": "^7.1.0",
|
|
78
|
+
"del-cli": "^5.1.0",
|
|
79
|
+
"eslint": "^8.56.0",
|
|
80
|
+
"eslint-config-prettier": "^9.1.0",
|
|
81
|
+
"eslint-plugin-import": "^2.29.1",
|
|
79
82
|
"file-loader": "^6.2.0",
|
|
80
|
-
"fs-extra": "^
|
|
83
|
+
"fs-extra": "^11.2.0",
|
|
81
84
|
"husky": "^8.0.3",
|
|
82
|
-
"jest": "^29.
|
|
83
|
-
"lint-staged": "^
|
|
85
|
+
"jest": "^29.7.0",
|
|
86
|
+
"lint-staged": "^15.2.0",
|
|
84
87
|
"npm-run-all": "^4.1.5",
|
|
85
|
-
"postcss-scss": "^4.0.
|
|
86
|
-
"prettier": "^2.
|
|
88
|
+
"postcss-scss": "^4.0.9",
|
|
89
|
+
"prettier": "^3.2.4",
|
|
87
90
|
"standard-version": "^9.5.0",
|
|
88
|
-
"stylelint": "^
|
|
89
|
-
"typescript": "^5.
|
|
90
|
-
"webpack": "^5.
|
|
91
|
+
"stylelint": "^16.2.0",
|
|
92
|
+
"typescript": "^5.3.3",
|
|
93
|
+
"webpack": "^5.90.0"
|
|
91
94
|
},
|
|
92
95
|
"keywords": [
|
|
93
96
|
"stylelint",
|
package/types/getStylelint.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export = getStylelint;
|
|
|
6
6
|
*/
|
|
7
7
|
declare function getStylelint(
|
|
8
8
|
key: string | undefined,
|
|
9
|
-
{ threads, ...options }: Options
|
|
9
|
+
{ threads, ...options }: Options,
|
|
10
10
|
): Linter;
|
|
11
11
|
declare namespace getStylelint {
|
|
12
12
|
export {
|
|
@@ -17,7 +17,6 @@ declare namespace getStylelint {
|
|
|
17
17
|
Formatter,
|
|
18
18
|
FormatterType,
|
|
19
19
|
Options,
|
|
20
|
-
isPathIgnored,
|
|
21
20
|
AsyncTask,
|
|
22
21
|
LintTask,
|
|
23
22
|
Linter,
|
|
@@ -27,7 +26,6 @@ declare namespace getStylelint {
|
|
|
27
26
|
type Options = import('./options').Options;
|
|
28
27
|
type Linter = {
|
|
29
28
|
stylelint: Stylelint;
|
|
30
|
-
isPathIgnored: isPathIgnored;
|
|
31
29
|
lintFiles: LintTask;
|
|
32
30
|
cleanup: AsyncTask;
|
|
33
31
|
threads: number;
|
|
@@ -43,10 +41,6 @@ type LinterOptions = import('stylelint').LinterOptions;
|
|
|
43
41
|
type LinterResult = import('stylelint').LinterResult;
|
|
44
42
|
type Formatter = import('stylelint').Formatter;
|
|
45
43
|
type FormatterType = import('stylelint').FormatterType;
|
|
46
|
-
type isPathIgnored = (
|
|
47
|
-
stylelint: Stylelint,
|
|
48
|
-
filePath: string
|
|
49
|
-
) => Promise<boolean>;
|
|
50
44
|
type AsyncTask = () => Promise<void>;
|
|
51
45
|
type LintTask = (files: string | string[]) => Promise<LintResult[]>;
|
|
52
46
|
type Worker = JestWorker & {
|
package/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ declare class StylelintWebpackPlugin {
|
|
|
16
16
|
compiler: Compiler,
|
|
17
17
|
options: Options,
|
|
18
18
|
wanted: string[],
|
|
19
|
-
exclude: string[]
|
|
19
|
+
exclude: string[],
|
|
20
20
|
): Promise<void>;
|
|
21
21
|
startTime: number;
|
|
22
22
|
prevTimestamps: Map<any, any>;
|
|
@@ -36,8 +36,8 @@ declare namespace StylelintWebpackPlugin {
|
|
|
36
36
|
export { Compiler, Module, Options, FileSystemInfoEntry };
|
|
37
37
|
}
|
|
38
38
|
type Compiler = import('webpack').Compiler;
|
|
39
|
-
type Options = import('./options').Options;
|
|
40
39
|
type Module = import('webpack').Module;
|
|
40
|
+
type Options = import('./options').Options;
|
|
41
41
|
type FileSystemInfoEntry = Partial<
|
|
42
42
|
| {
|
|
43
43
|
timestamp: number;
|
package/types/linter.d.ts
CHANGED
|
@@ -3,15 +3,13 @@ export = linter;
|
|
|
3
3
|
* @param {string|undefined} key
|
|
4
4
|
* @param {Options} options
|
|
5
5
|
* @param {Compilation} compilation
|
|
6
|
-
* @returns {{
|
|
6
|
+
* @returns {{lint: Linter, report: Reporter, threads: number}}
|
|
7
7
|
*/
|
|
8
8
|
declare function linter(
|
|
9
9
|
key: string | undefined,
|
|
10
10
|
options: Options,
|
|
11
|
-
compilation: Compilation
|
|
11
|
+
compilation: Compilation,
|
|
12
12
|
): {
|
|
13
|
-
stylelint: Stylelint;
|
|
14
|
-
isPathIgnored: getStylelint.isPathIgnored;
|
|
15
13
|
lint: Linter;
|
|
16
14
|
report: Reporter;
|
|
17
15
|
threads: number;
|
|
@@ -25,7 +23,6 @@ declare namespace linter {
|
|
|
25
23
|
LinterResult,
|
|
26
24
|
Formatter,
|
|
27
25
|
FormatterType,
|
|
28
|
-
isPathIgnored,
|
|
29
26
|
Options,
|
|
30
27
|
GenerateReport,
|
|
31
28
|
Report,
|
|
@@ -36,16 +33,14 @@ declare namespace linter {
|
|
|
36
33
|
}
|
|
37
34
|
type Options = import('./options').Options;
|
|
38
35
|
type Compilation = import('webpack').Compilation;
|
|
39
|
-
type Stylelint = import('./getStylelint').Stylelint;
|
|
40
36
|
type Linter = (files: string | string[]) => void;
|
|
41
37
|
type Reporter = () => Promise<Report>;
|
|
42
|
-
import getStylelint = require('./getStylelint');
|
|
43
38
|
type Compiler = import('webpack').Compiler;
|
|
39
|
+
type Stylelint = import('./getStylelint').Stylelint;
|
|
44
40
|
type LintResult = import('./getStylelint').LintResult;
|
|
45
41
|
type LinterResult = import('./getStylelint').LinterResult;
|
|
46
42
|
type Formatter = import('./getStylelint').Formatter;
|
|
47
43
|
type FormatterType = import('./getStylelint').FormatterType;
|
|
48
|
-
type isPathIgnored = import('./getStylelint').isPathIgnored;
|
|
49
44
|
type GenerateReport = (compilation: Compilation) => Promise<void>;
|
|
50
45
|
type Report = {
|
|
51
46
|
errors?: StylelintError;
|
package/types/options.d.ts
CHANGED
package/types/utils.d.ts
CHANGED
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
}
|
|
15
15
|
*/
|
|
16
16
|
export function arrify<T>(
|
|
17
|
-
value: T
|
|
17
|
+
value: T,
|
|
18
18
|
): T extends null | undefined
|
|
19
19
|
? []
|
|
20
20
|
: T extends string
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
? [string]
|
|
22
|
+
: T extends readonly unknown[]
|
|
23
|
+
? T
|
|
24
|
+
: T extends Iterable<infer T_1>
|
|
25
|
+
? T_1[]
|
|
26
|
+
: [T];
|
|
27
27
|
/**
|
|
28
28
|
* @param {string|string[]} files
|
|
29
29
|
* @param {string} context
|
|
@@ -37,7 +37,7 @@ export function parseFiles(files: string | string[], context: string): string[];
|
|
|
37
37
|
*/
|
|
38
38
|
export function parseFoldersToGlobs(
|
|
39
39
|
patterns: string | string[],
|
|
40
|
-
extensions?: string | string[]
|
|
40
|
+
extensions?: string | string[],
|
|
41
41
|
): string[];
|
|
42
42
|
/**
|
|
43
43
|
*
|