stylelint-webpack-plugin 2.2.2 → 2.3.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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="stylelint" />
1
2
  /**
2
3
  * @param {string|undefined} key
3
4
  * @param {Options} options
@@ -7,7 +8,54 @@ export default function getStylelint(
7
8
  key: string | undefined,
8
9
  { threads, ...options }: Options
9
10
  ): Linter;
10
- export type Stylelint = typeof import('stylelint');
11
+ export type Stylelint = import('stylelint/node_modules/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('stylelint/node_modules/postcss').Root;
52
+ },
53
+ callback: (
54
+ warning: import('stylelint/node_modules/postcss').Warning
55
+ ) => void
56
+ ) => void;
57
+ };
58
+ };
11
59
  export type LintResult = import('stylelint').LintResult;
12
60
  export type Options = import('./options').Options;
13
61
  export type AsyncTask = () => Promise<void>;
@@ -20,7 +20,11 @@ declare class StylelintWebpackPlugin {
20
20
  */
21
21
  run(compiler: Compiler): Promise<void>;
22
22
  startTime: number;
23
- prevTimestamps: Map<any, any>;
23
+ /** @type {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} */
24
+ prevTimestamps: ReadonlyMap<
25
+ string,
26
+ 'ignore' | FileSystemInfoEntry | null | undefined
27
+ >;
24
28
  /**
25
29
  * @param {Compiler} compiler
26
30
  * @returns {void}
@@ -40,10 +44,13 @@ declare class StylelintWebpackPlugin {
40
44
  */
41
45
  getFiles(compiler: Compiler, wanted: string[], exclude: string[]): string[];
42
46
  /**
43
- * @param {Map<string, null | FileSystemInfoEntry | "ignore">} fileTimestamps
47
+ * @param {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} fileTimestamps
44
48
  * @returns {string[]}
45
49
  */
46
50
  getChangedFiles(
47
- fileTimestamps: Map<string, 'ignore' | FileSystemInfoEntry | null>
51
+ fileTimestamps: ReadonlyMap<
52
+ string,
53
+ 'ignore' | FileSystemInfoEntry | null | undefined
54
+ >
48
55
  ): string[];
49
56
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="stylelint" />
1
2
  /**
2
3
  * @param {string|undefined} key
3
4
  * @param {Options} options
@@ -13,7 +14,54 @@ export default function linter(
13
14
  report: Reporter;
14
15
  threads: number;
15
16
  };
16
- export type Stylelint = typeof import('stylelint');
17
+ export type Stylelint = import('stylelint/node_modules/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('stylelint/node_modules/postcss').Root;
58
+ },
59
+ callback: (
60
+ warning: import('stylelint/node_modules/postcss').Warning
61
+ ) => void
62
+ ) => void;
63
+ };
64
+ };
17
65
  export type LintResult = import('stylelint').LintResult;
18
66
  export type Compiler = import('webpack').Compiler;
19
67
  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,54 @@ export function getOptions(pluginOptions: Options): Partial<PluginOptions>;
36
37
  export function getStylelintOptions(
37
38
  pluginOptions: Options
38
39
  ): Partial<StylelintOptions>;
39
- export type stylelint = typeof import('stylelint');
40
+ export type stylelint = import('stylelint/node_modules/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('stylelint/node_modules/postcss').Root;
81
+ },
82
+ callback: (
83
+ warning: import('stylelint/node_modules/postcss').Warning
84
+ ) => void
85
+ ) => void;
86
+ };
87
+ };
40
88
  export type StylelintOptions = import('stylelint').LinterOptions;
41
89
  export type FormatterType = import('stylelint').FormatterType;
42
90
  export type OutputReport = {
@@ -1,3 +1,51 @@
1
- export type Stylelint = typeof import('stylelint');
1
+ /// <reference types="stylelint" />
2
+ export type Stylelint = import('stylelint/node_modules/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('stylelint/node_modules/postcss').Root;
43
+ },
44
+ callback: (
45
+ warning: import('stylelint/node_modules/postcss').Warning
46
+ ) => void
47
+ ) => void;
48
+ };
49
+ };
2
50
  export type StylelintOptions = import('stylelint').LinterOptions;
3
51
  export type Options = import('./options').Options;
package/dist/index.js CHANGED
@@ -43,6 +43,8 @@ class StylelintWebpackPlugin {
43
43
  this.options = (0, _options.getOptions)(options);
44
44
  this.run = this.run.bind(this);
45
45
  this.startTime = Date.now();
46
+ /** @type {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} */
47
+
46
48
  this.prevTimestamps = new Map();
47
49
  }
48
50
  /**
@@ -213,7 +215,7 @@ class StylelintWebpackPlugin {
213
215
  });
214
216
  }
215
217
  /**
216
- * @param {Map<string, null | FileSystemInfoEntry | "ignore">} fileTimestamps
218
+ * @param {ReadonlyMap<string, null | FileSystemInfoEntry | "ignore" | undefined>} fileTimestamps
217
219
  * @returns {string[]}
218
220
  */
219
221
 
@@ -222,7 +224,7 @@ class StylelintWebpackPlugin {
222
224
 
223
225
  getChangedFiles(fileTimestamps) {
224
226
  /**
225
- * @param {null | FileSystemInfoEntry | "ignore"} fileSystemInfoEntry
227
+ * @param {null | FileSystemInfoEntry | "ignore" | undefined} fileSystemInfoEntry
226
228
  * @returns {Partial<number>}
227
229
  */
228
230
  const getTimestamps = fileSystemInfoEntry => {
@@ -237,7 +239,7 @@ class StylelintWebpackPlugin {
237
239
  };
238
240
  /**
239
241
  * @param {string} filename
240
- * @param {null | FileSystemInfoEntry | "ignore"} fileSystemInfoEntry
242
+ * @param {null | FileSystemInfoEntry | "ignore" | undefined} fileSystemInfoEntry
241
243
  * @returns {boolean}
242
244
  */
243
245
 
package/dist/linter.js CHANGED
@@ -105,7 +105,7 @@ function linter(key, options, compilation) {
105
105
  await cleanup();
106
106
 
107
107
  for (const result of results) {
108
- crossRunResultStorage[result.source] = result;
108
+ crossRunResultStorage[String(result.source)] = result;
109
109
  }
110
110
 
111
111
  results = Object.values(crossRunResultStorage); // do not analyze if there are no results or stylelint config
package/dist/utils.js CHANGED
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.jsonStringifyReplacerSortKeys = void 0;
6
7
  exports.parseFiles = parseFiles;
7
8
  exports.parseFoldersToGlobs = parseFoldersToGlobs;
8
- exports.jsonStringifyReplacerSortKeys = void 0;
9
9
 
10
10
  var _path = require("path");
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-webpack-plugin",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "description": "A Stylelint plugin for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/stylelint-webpack-plugin",
@@ -42,49 +42,50 @@
42
42
  "declarations"
43
43
  ],
44
44
  "peerDependencies": {
45
- "stylelint": "^13.0.0",
45
+ "stylelint": "^13.0.0 || ^14.0.0",
46
46
  "webpack": "^4.0.0 || ^5.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@types/stylelint": "^13.13.0",
49
+ "@types/stylelint": "^13.13.3",
50
50
  "arrify": "^2.0.1",
51
- "jest-worker": "^27.0.2",
51
+ "jest-worker": "^27.3.1",
52
52
  "globby": "^11.0.4",
53
53
  "micromatch": "^4.0.4",
54
54
  "normalize-path": "^3.0.0",
55
- "schema-utils": "^3.0.0"
55
+ "schema-utils": "^3.1.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@babel/cli": "^7.14.5",
59
- "@babel/core": "^7.14.6",
60
- "@babel/preset-env": "^7.14.5",
58
+ "@babel/cli": "^7.16.0",
59
+ "@babel/core": "^7.16.0",
60
+ "@babel/preset-env": "^7.16.0",
61
61
  "@commitlint/cli": "^12.1.4",
62
62
  "@commitlint/config-conventional": "^12.1.4",
63
- "@types/fs-extra": "^9.0.11",
64
- "@types/micromatch": "^4.0.1",
63
+ "@types/fs-extra": "^9.0.13",
64
+ "@types/micromatch": "^4.0.2",
65
65
  "@types/normalize-path": "^3.0.0",
66
66
  "@types/webpack": "^5.28.0",
67
67
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
68
68
  "babel-eslint": "^10.1.0",
69
- "babel-jest": "^27.0.2",
69
+ "babel-jest": "^27.3.1",
70
70
  "chokidar": "^3.5.2",
71
71
  "cross-env": "^7.0.3",
72
72
  "del": "^6.0.0",
73
73
  "del-cli": "^3.0.1",
74
- "eslint": "^7.28.0",
74
+ "eslint": "^7.32.0",
75
75
  "eslint-config-prettier": "^8.3.0",
76
- "eslint-plugin-import": "^2.23.4",
76
+ "eslint-plugin-import": "^2.25.2",
77
77
  "file-loader": "^6.2.0",
78
78
  "fs-extra": "^9.1.0",
79
79
  "husky": "^6.0.0",
80
- "jest": "^27.0.4",
80
+ "jest": "^27.3.1",
81
81
  "lint-staged": "^10.5.4",
82
82
  "npm-run-all": "^4.1.5",
83
- "prettier": "^2.3.1",
84
- "standard-version": "^9.3.0",
85
- "stylelint": "^13.13.1",
86
- "typescript": "^4.3.2",
87
- "webpack": "^5.39.0"
83
+ "postcss-scss": "^3.0.5",
84
+ "prettier": "^2.4.1",
85
+ "standard-version": "^9.3.2",
86
+ "stylelint": "^14.0.1",
87
+ "typescript": "^4.4.4",
88
+ "webpack": "^5.62.1"
88
89
  },
89
90
  "keywords": [
90
91
  "stylelint",