stylelint-webpack-plugin 2.4.0 → 2.5.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/dist/StylelintError.js +0 -2
- package/dist/getStylelint.js +32 -37
- package/dist/index.js +32 -63
- package/dist/linter.js +76 -86
- package/dist/options.js +14 -17
- package/dist/utils.js +7 -20
- package/dist/worker.js +11 -11
- package/package.json +19 -19
- package/types/getStylelint.d.ts +16 -52
- package/types/linter.d.ts +16 -66
- package/types/options.d.ts +4 -61
- package/types/worker.d.ts +2 -57
package/types/getStylelint.d.ts
CHANGED
|
@@ -13,7 +13,12 @@ declare namespace getStylelint {
|
|
|
13
13
|
export {
|
|
14
14
|
Stylelint,
|
|
15
15
|
LintResult,
|
|
16
|
+
LinterOptions,
|
|
17
|
+
LinterResult,
|
|
18
|
+
Formatter,
|
|
19
|
+
FormatterType,
|
|
16
20
|
Options,
|
|
21
|
+
isPathIgnored,
|
|
17
22
|
AsyncTask,
|
|
18
23
|
LintTask,
|
|
19
24
|
Linter,
|
|
@@ -22,68 +27,27 @@ declare namespace getStylelint {
|
|
|
22
27
|
}
|
|
23
28
|
type Options = import('./options').Options;
|
|
24
29
|
type Linter = {
|
|
25
|
-
api: import('stylelint').InternalApi;
|
|
26
30
|
stylelint: Stylelint;
|
|
31
|
+
isPathIgnored: isPathIgnored;
|
|
27
32
|
lintFiles: LintTask;
|
|
28
33
|
cleanup: AsyncTask;
|
|
29
34
|
threads: number;
|
|
30
35
|
};
|
|
31
|
-
type Stylelint =
|
|
32
|
-
|
|
33
|
-
> & {
|
|
34
|
-
lint: (
|
|
35
|
-
options: import('stylelint').LinterOptions
|
|
36
|
-
) => Promise<import('stylelint').LinterResult>;
|
|
37
|
-
rules: {
|
|
38
|
-
[k: string]: import('stylelint').Rule<any, any>;
|
|
39
|
-
};
|
|
36
|
+
type Stylelint = {
|
|
37
|
+
lint: (options: LinterOptions) => Promise<LinterResult>;
|
|
40
38
|
formatters: {
|
|
41
39
|
[k: string]: import('stylelint').Formatter;
|
|
42
40
|
};
|
|
43
|
-
createPlugin: (
|
|
44
|
-
ruleName: string,
|
|
45
|
-
plugin: import('stylelint').Plugin<any, any>
|
|
46
|
-
) => {
|
|
47
|
-
ruleName: string;
|
|
48
|
-
rule: import('stylelint').Rule<any, any>;
|
|
49
|
-
};
|
|
50
|
-
createLinter: (
|
|
51
|
-
options: import('stylelint').LinterOptions
|
|
52
|
-
) => import('stylelint').InternalApi;
|
|
53
|
-
resolveConfig: (
|
|
54
|
-
filePath: string,
|
|
55
|
-
options?:
|
|
56
|
-
| Pick<
|
|
57
|
-
import('stylelint').LinterOptions,
|
|
58
|
-
'cwd' | 'config' | 'configFile' | 'configBasedir'
|
|
59
|
-
>
|
|
60
|
-
| undefined
|
|
61
|
-
) => Promise<import('stylelint').Config | undefined>;
|
|
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
41
|
};
|
|
86
42
|
type LintResult = import('stylelint').LintResult;
|
|
43
|
+
type LinterOptions = import('stylelint').LinterOptions;
|
|
44
|
+
type LinterResult = import('stylelint').LinterResult;
|
|
45
|
+
type Formatter = import('stylelint').Formatter;
|
|
46
|
+
type FormatterType = import('stylelint').FormatterType;
|
|
47
|
+
type isPathIgnored = (
|
|
48
|
+
stylelint: Stylelint,
|
|
49
|
+
filePath: string
|
|
50
|
+
) => Promise<boolean>;
|
|
87
51
|
type AsyncTask = () => Promise<void>;
|
|
88
52
|
type LintTask = (files: string | string[]) => Promise<LintResult[]>;
|
|
89
53
|
type Worker = JestWorker & {
|
package/types/linter.d.ts
CHANGED
|
@@ -4,28 +4,30 @@ 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;
|
|
18
19
|
};
|
|
19
20
|
declare namespace linter {
|
|
20
21
|
export {
|
|
21
|
-
Stylelint,
|
|
22
|
-
LintResult,
|
|
23
|
-
InternalApi,
|
|
24
22
|
Compiler,
|
|
25
23
|
Compilation,
|
|
26
|
-
|
|
24
|
+
Stylelint,
|
|
25
|
+
LintResult,
|
|
26
|
+
LinterResult,
|
|
27
|
+
Formatter,
|
|
27
28
|
FormatterType,
|
|
28
|
-
|
|
29
|
+
isPathIgnored,
|
|
30
|
+
Options,
|
|
29
31
|
GenerateReport,
|
|
30
32
|
Report,
|
|
31
33
|
Reporter,
|
|
@@ -35,68 +37,16 @@ declare namespace linter {
|
|
|
35
37
|
}
|
|
36
38
|
type Options = import('./options').Options;
|
|
37
39
|
type Compilation = import('webpack').Compilation;
|
|
38
|
-
type
|
|
40
|
+
type Stylelint = import('./getStylelint').Stylelint;
|
|
39
41
|
type Linter = (files: string | string[]) => void;
|
|
40
42
|
type Reporter = () => Promise<Report>;
|
|
41
|
-
|
|
42
|
-
import('stylelint').PostcssPluginOptions
|
|
43
|
-
> & {
|
|
44
|
-
lint: (
|
|
45
|
-
options: import('stylelint').LinterOptions
|
|
46
|
-
) => Promise<import('stylelint').LinterResult>;
|
|
47
|
-
rules: {
|
|
48
|
-
[k: string]: import('stylelint').Rule<any, any>;
|
|
49
|
-
};
|
|
50
|
-
formatters: {
|
|
51
|
-
[k: string]: import('stylelint').Formatter;
|
|
52
|
-
};
|
|
53
|
-
createPlugin: (
|
|
54
|
-
ruleName: string,
|
|
55
|
-
plugin: import('stylelint').Plugin<any, any>
|
|
56
|
-
) => {
|
|
57
|
-
ruleName: string;
|
|
58
|
-
rule: import('stylelint').Rule<any, any>;
|
|
59
|
-
};
|
|
60
|
-
createLinter: (
|
|
61
|
-
options: import('stylelint').LinterOptions
|
|
62
|
-
) => import('stylelint').InternalApi;
|
|
63
|
-
resolveConfig: (
|
|
64
|
-
filePath: string,
|
|
65
|
-
options?:
|
|
66
|
-
| Pick<
|
|
67
|
-
import('stylelint').LinterOptions,
|
|
68
|
-
'cwd' | 'config' | 'configFile' | 'configBasedir'
|
|
69
|
-
>
|
|
70
|
-
| undefined
|
|
71
|
-
) => Promise<import('stylelint').Config | undefined>;
|
|
72
|
-
utils: {
|
|
73
|
-
report: (problem: import('stylelint').Problem) => void;
|
|
74
|
-
ruleMessages: <
|
|
75
|
-
T extends import('stylelint').RuleMessages,
|
|
76
|
-
R extends { [K in keyof T]: T[K] }
|
|
77
|
-
>(
|
|
78
|
-
ruleName: string,
|
|
79
|
-
messages: T
|
|
80
|
-
) => R;
|
|
81
|
-
validateOptions: (
|
|
82
|
-
result: import('stylelint').PostcssResult,
|
|
83
|
-
ruleName: string,
|
|
84
|
-
...optionDescriptions: import('stylelint').RuleOptions[]
|
|
85
|
-
) => boolean;
|
|
86
|
-
checkAgainstRule: <T_1, O extends Object>(
|
|
87
|
-
options: {
|
|
88
|
-
ruleName: string;
|
|
89
|
-
ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
|
|
90
|
-
root: import('postcss').Root;
|
|
91
|
-
},
|
|
92
|
-
callback: (warning: import('postcss').Warning) => void
|
|
93
|
-
) => void;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
type LintResult = import('stylelint').LintResult;
|
|
43
|
+
import getStylelint = require('./getStylelint');
|
|
97
44
|
type Compiler = import('webpack').Compiler;
|
|
98
|
-
type
|
|
99
|
-
type
|
|
45
|
+
type LintResult = import('./getStylelint').LintResult;
|
|
46
|
+
type LinterResult = import('./getStylelint').LinterResult;
|
|
47
|
+
type Formatter = import('./getStylelint').Formatter;
|
|
48
|
+
type FormatterType = import('./getStylelint').FormatterType;
|
|
49
|
+
type isPathIgnored = import('./getStylelint').isPathIgnored;
|
|
100
50
|
type GenerateReport = (compilation: Compilation) => Promise<void>;
|
|
101
51
|
type Report = {
|
|
102
52
|
errors?: StylelintError;
|
package/types/options.d.ts
CHANGED
|
@@ -1,61 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
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
|
-
resolveConfig: (
|
|
25
|
-
filePath: string,
|
|
26
|
-
options?:
|
|
27
|
-
| Pick<
|
|
28
|
-
import('stylelint').LinterOptions,
|
|
29
|
-
'cwd' | 'config' | 'configFile' | 'configBasedir'
|
|
30
|
-
>
|
|
31
|
-
| undefined
|
|
32
|
-
) => Promise<import('stylelint').Config | undefined>;
|
|
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
|
-
};
|
|
57
|
-
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
58
|
-
export type FormatterType = import('stylelint').FormatterType;
|
|
1
|
+
export type StylelintOptions = import('./getStylelint').LinterOptions;
|
|
2
|
+
export type FormatterType = import('./getStylelint').FormatterType;
|
|
59
3
|
export type OutputReport = {
|
|
60
4
|
filePath?: string | undefined;
|
|
61
5
|
formatter?: FormatterType | undefined;
|
|
@@ -77,9 +21,8 @@ export type PluginOptions = {
|
|
|
77
21
|
threads?: (number | boolean) | undefined;
|
|
78
22
|
};
|
|
79
23
|
export type Options = Partial<PluginOptions & StylelintOptions>;
|
|
80
|
-
/** @typedef {import(
|
|
81
|
-
/** @typedef {import(
|
|
82
|
-
/** @typedef {import("stylelint").FormatterType} FormatterType */
|
|
24
|
+
/** @typedef {import('./getStylelint').LinterOptions} StylelintOptions */
|
|
25
|
+
/** @typedef {import('./getStylelint').FormatterType} FormatterType */
|
|
83
26
|
/**
|
|
84
27
|
* @typedef {Object} OutputReport
|
|
85
28
|
* @property {string=} filePath
|
package/types/worker.d.ts
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
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
|
-
resolveConfig: (
|
|
25
|
-
filePath: string,
|
|
26
|
-
options?:
|
|
27
|
-
| Pick<
|
|
28
|
-
import('stylelint').LinterOptions,
|
|
29
|
-
'cwd' | 'config' | 'configFile' | 'configBasedir'
|
|
30
|
-
>
|
|
31
|
-
| undefined
|
|
32
|
-
) => Promise<import('stylelint').Config | undefined>;
|
|
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
|
-
};
|
|
57
|
-
export type StylelintOptions = import('stylelint').LinterOptions;
|
|
1
|
+
export type Stylelint = import('./getStylelint').Stylelint;
|
|
2
|
+
export type StylelintOptions = import('./getStylelint').LinterOptions;
|
|
58
3
|
export type Options = import('./options').Options;
|