stylelint-webpack-plugin 4.0.0 → 4.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.
@@ -22,8 +22,12 @@ const {
22
22
  /** @type {{[key: string]: any}} */
23
23
  const cache = {};
24
24
 
25
- /** @typedef {import('stylelint')} Stylelint */
25
+ /** @typedef {{lint: (options: LinterOptions) => Promise<LinterResult>, formatters: { [k: string]: Formatter }}} Stylelint */
26
26
  /** @typedef {import('stylelint').LintResult} LintResult */
27
+ /** @typedef {import('stylelint').LinterOptions} LinterOptions */
28
+ /** @typedef {import('stylelint').LinterResult} LinterResult */
29
+ /** @typedef {import('stylelint').Formatter} Formatter */
30
+ /** @typedef {import('stylelint').FormatterType} FormatterType */
27
31
  /** @typedef {import('./options').Options} Options */
28
32
  /** @typedef {(stylelint: Stylelint, filePath: string) => Promise<boolean>} isPathIgnored */
29
33
  /** @typedef {() => Promise<void>} AsyncTask */
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ class StylelintWebpackPlugin {
89
89
  return;
90
90
  }
91
91
  compiler.hooks.thisCompilation.tap(this.key, compilation => {
92
- /** @type {import('stylelint')} */
92
+ /** @type {import('./getStylelint').Stylelint} */
93
93
  let stylelint;
94
94
 
95
95
  /** @type {import('./linter').Linter} */
package/dist/linter.js CHANGED
@@ -11,15 +11,15 @@ const {
11
11
  arrify
12
12
  } = require('./utils');
13
13
 
14
- /** @typedef {import('stylelint')} Stylelint */
15
- /** @typedef {import('stylelint').LintResult} LintResult */
16
- /** @typedef {import('stylelint').LinterResult} LinterResult */
17
- /** @typedef {import('stylelint').Formatter} Formatter */
18
- /** @typedef {import('stylelint').FormatterType} FormatterType */
19
14
  /** @typedef {import('webpack').Compiler} Compiler */
20
15
  /** @typedef {import('webpack').Compilation} Compilation */
21
- /** @typedef {import('./options').Options} Options */
16
+ /** @typedef {import('./getStylelint').Stylelint} Stylelint */
17
+ /** @typedef {import('./getStylelint').LintResult} LintResult */
18
+ /** @typedef {import('./getStylelint').LinterResult} LinterResult */
19
+ /** @typedef {import('./getStylelint').Formatter} Formatter */
20
+ /** @typedef {import('./getStylelint').FormatterType} FormatterType */
22
21
  /** @typedef {import('./getStylelint').isPathIgnored} isPathIgnored */
22
+ /** @typedef {import('./options').Options} Options */
23
23
  /** @typedef {(compilation: Compilation) => Promise<void>} GenerateReport */
24
24
  /** @typedef {{errors?: StylelintError, warnings?: StylelintError, generateReportAsset?: GenerateReport}} Report */
25
25
  /** @typedef {() => Promise<Report>} Reporter */
package/dist/options.js CHANGED
@@ -5,9 +5,8 @@ const {
5
5
  } = require('schema-utils');
6
6
  const schema = require('./options.json');
7
7
 
8
- /** @typedef {import("stylelint")} stylelint */
9
- /** @typedef {import("stylelint").LinterOptions} StylelintOptions */
10
- /** @typedef {import("stylelint").FormatterType} FormatterType */
8
+ /** @typedef {import('./getStylelint').LinterOptions} StylelintOptions */
9
+ /** @typedef {import('./getStylelint').FormatterType} FormatterType */
11
10
 
12
11
  /**
13
12
  * @typedef {Object} OutputReport
package/dist/worker.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
- /** @typedef {import('stylelint')} Stylelint */
4
- /** @typedef {import("stylelint").LinterOptions} StylelintOptions */
3
+ /** @typedef {import('./getStylelint').Stylelint} Stylelint */
4
+ /** @typedef {import('./getStylelint').LinterOptions} StylelintOptions */
5
5
  /** @typedef {import('./options').Options} Options */
6
6
 
7
7
  Object.assign(module.exports, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-webpack-plugin",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "A Stylelint plugin for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/stylelint-webpack-plugin",
@@ -43,12 +43,12 @@
43
43
  "types"
44
44
  ],
45
45
  "peerDependencies": {
46
- "stylelint": "^13.0.0 || ^14.0.0",
46
+ "stylelint": "^13.0.0 || ^14.0.0 || ^15.0.0",
47
47
  "webpack": "^5.0.0"
48
48
  },
49
49
  "dependencies": {
50
50
  "globby": "^11.1.0",
51
- "jest-worker": "^29.4.1",
51
+ "jest-worker": "^29.4.2",
52
52
  "micromatch": "^4.0.5",
53
53
  "normalize-path": "^3.0.0",
54
54
  "schema-utils": "^4.0.0"
@@ -62,30 +62,30 @@
62
62
  "@types/file-entry-cache": "^5.0.2",
63
63
  "@types/fs-extra": "^9.0.13",
64
64
  "@types/micromatch": "^4.0.2",
65
- "@types/node": "^18.11.18",
65
+ "@types/node": "^18.13.0",
66
66
  "@types/normalize-path": "^3.0.0",
67
67
  "@types/webpack": "^5.28.0",
68
68
  "@webpack-contrib/eslint-config-webpack": "^3.0.0",
69
69
  "babel-eslint": "^10.1.0",
70
- "babel-jest": "^29.4.1",
70
+ "babel-jest": "^29.4.2",
71
71
  "chokidar": "^3.5.3",
72
72
  "cross-env": "^7.0.3",
73
- "cspell": "^6.20.1",
73
+ "cspell": "^6.22.0",
74
74
  "del": "^6.1.1",
75
75
  "del-cli": "^4.0.1",
76
- "eslint": "^8.33.0",
76
+ "eslint": "^8.34.0",
77
77
  "eslint-config-prettier": "^8.6.0",
78
78
  "eslint-plugin-import": "^2.27.5",
79
79
  "file-loader": "^6.2.0",
80
80
  "fs-extra": "^10.1.0",
81
81
  "husky": "^8.0.3",
82
- "jest": "^29.4.1",
83
- "lint-staged": "^13.1.0",
82
+ "jest": "^29.4.2",
83
+ "lint-staged": "^13.1.1",
84
84
  "npm-run-all": "^4.1.5",
85
85
  "postcss-scss": "^4.0.6",
86
- "prettier": "^2.8.3",
86
+ "prettier": "^2.8.4",
87
87
  "standard-version": "^9.5.0",
88
- "stylelint": "^14.16.1",
88
+ "stylelint": "^15.0.0",
89
89
  "typescript": "^4.9.5",
90
90
  "webpack": "^5.75.0"
91
91
  },
@@ -13,6 +13,10 @@ declare namespace getStylelint {
13
13
  export {
14
14
  Stylelint,
15
15
  LintResult,
16
+ LinterOptions,
17
+ LinterResult,
18
+ Formatter,
19
+ FormatterType,
16
20
  Options,
17
21
  isPathIgnored,
18
22
  AsyncTask,
@@ -29,67 +33,17 @@ type Linter = {
29
33
  cleanup: AsyncTask;
30
34
  threads: number;
31
35
  };
32
- type Stylelint = import('postcss').PluginCreator<
33
- import('stylelint').PostcssPluginOptions
34
- > & {
35
- lint: (
36
- options: import('stylelint').LinterOptions
37
- ) => Promise<import('stylelint').LinterResult>;
38
- rules: {
39
- [k: string]: import('stylelint').Rule<any, any>;
40
- };
36
+ type Stylelint = {
37
+ lint: (options: LinterOptions) => Promise<LinterResult>;
41
38
  formatters: {
42
39
  [k: string]: import('stylelint').Formatter;
43
40
  };
44
- createPlugin: (
45
- ruleName: string,
46
- rule: import('stylelint').Rule<any, any>
47
- ) => {
48
- ruleName: string;
49
- rule: import('stylelint').Rule<any, any>;
50
- };
51
- createLinter: (
52
- options: import('stylelint').LinterOptions
53
- ) => import('stylelint').InternalApi;
54
- resolveConfig: (
55
- filePath: string,
56
- options?:
57
- | Pick<
58
- import('stylelint').LinterOptions,
59
- 'cwd' | 'config' | 'configFile' | 'configBasedir'
60
- >
61
- | undefined
62
- ) => Promise<import('stylelint').Config | undefined>;
63
- utils: {
64
- report: (problem: import('stylelint').Problem) => void;
65
- ruleMessages: <
66
- T extends import('stylelint').RuleMessages,
67
- R extends { [K in keyof T]: T[K] }
68
- >(
69
- ruleName: string,
70
- messages: T
71
- ) => R;
72
- validateOptions: (
73
- result: import('stylelint').PostcssResult,
74
- ruleName: string,
75
- ...optionDescriptions: import('stylelint').RuleOptions[]
76
- ) => boolean;
77
- checkAgainstRule: <T_1, O extends Object>(
78
- options: {
79
- ruleName: string;
80
- ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
81
- root: import('postcss').Root;
82
- result?: import('stylelint').PostcssResult | undefined;
83
- context?: import('stylelint').RuleContext | undefined;
84
- },
85
- callback: (warning: import('postcss').Warning) => void
86
- ) => void;
87
- };
88
- reference: {
89
- longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
90
- };
91
41
  };
92
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;
93
47
  type isPathIgnored = (
94
48
  stylelint: Stylelint,
95
49
  filePath: string
package/types/linter.d.ts CHANGED
@@ -19,15 +19,15 @@ declare function linter(
19
19
  };
20
20
  declare namespace linter {
21
21
  export {
22
+ Compiler,
23
+ Compilation,
22
24
  Stylelint,
23
25
  LintResult,
24
26
  LinterResult,
25
27
  Formatter,
26
28
  FormatterType,
27
- Compiler,
28
- Compilation,
29
- Options,
30
29
  isPathIgnored,
30
+ Options,
31
31
  GenerateReport,
32
32
  Report,
33
33
  Reporter,
@@ -37,74 +37,15 @@ declare namespace linter {
37
37
  }
38
38
  type Options = import('./options').Options;
39
39
  type Compilation = import('webpack').Compilation;
40
- 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
- rule: import('stylelint').Rule<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
- resolveConfig: (
63
- filePath: string,
64
- options?:
65
- | Pick<
66
- import('stylelint').LinterOptions,
67
- 'cwd' | 'config' | 'configFile' | 'configBasedir'
68
- >
69
- | undefined
70
- ) => Promise<import('stylelint').Config | undefined>;
71
- utils: {
72
- report: (problem: import('stylelint').Problem) => void;
73
- ruleMessages: <
74
- T extends import('stylelint').RuleMessages,
75
- R extends { [K in keyof T]: T[K] }
76
- >(
77
- ruleName: string,
78
- messages: T
79
- ) => R;
80
- validateOptions: (
81
- result: import('stylelint').PostcssResult,
82
- ruleName: string,
83
- ...optionDescriptions: import('stylelint').RuleOptions[]
84
- ) => boolean;
85
- checkAgainstRule: <T_1, O extends Object>(
86
- options: {
87
- ruleName: string;
88
- ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
89
- root: import('postcss').Root;
90
- result?: import('stylelint').PostcssResult | undefined;
91
- context?: import('stylelint').RuleContext | undefined;
92
- },
93
- callback: (warning: import('postcss').Warning) => void
94
- ) => void;
95
- };
96
- reference: {
97
- longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
98
- };
99
- };
40
+ type Stylelint = import('./getStylelint').Stylelint;
100
41
  type Linter = (files: string | string[]) => void;
101
42
  type Reporter = () => Promise<Report>;
102
43
  import getStylelint = require('./getStylelint');
103
- type LintResult = import('stylelint').LintResult;
104
- type LinterResult = import('stylelint').LinterResult;
105
- type Formatter = import('stylelint').Formatter;
106
- type FormatterType = import('stylelint').FormatterType;
107
44
  type Compiler = import('webpack').Compiler;
45
+ type LintResult = import('./getStylelint').LintResult;
46
+ type LinterResult = import('./getStylelint').LinterResult;
47
+ type Formatter = import('./getStylelint').Formatter;
48
+ type FormatterType = import('./getStylelint').FormatterType;
108
49
  type isPathIgnored = import('./getStylelint').isPathIgnored;
109
50
  type GenerateReport = (compilation: Compilation) => Promise<void>;
110
51
  type Report = {
@@ -1,66 +1,5 @@
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
- rule: import('stylelint').Rule<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
- result?: import('stylelint').PostcssResult | undefined;
53
- context?: import('stylelint').RuleContext | undefined;
54
- },
55
- callback: (warning: import('postcss').Warning) => void
56
- ) => void;
57
- };
58
- reference: {
59
- longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
60
- };
61
- };
62
- export type StylelintOptions = import('stylelint').LinterOptions;
63
- export type FormatterType = import('stylelint').FormatterType;
1
+ export type StylelintOptions = import('./getStylelint').LinterOptions;
2
+ export type FormatterType = import('./getStylelint').FormatterType;
64
3
  export type OutputReport = {
65
4
  filePath?: string | undefined;
66
5
  formatter?: FormatterType | undefined;
@@ -82,9 +21,8 @@ export type PluginOptions = {
82
21
  threads?: (number | boolean) | undefined;
83
22
  };
84
23
  export type Options = Partial<PluginOptions & StylelintOptions>;
85
- /** @typedef {import("stylelint")} stylelint */
86
- /** @typedef {import("stylelint").LinterOptions} StylelintOptions */
87
- /** @typedef {import("stylelint").FormatterType} FormatterType */
24
+ /** @typedef {import('./getStylelint').LinterOptions} StylelintOptions */
25
+ /** @typedef {import('./getStylelint').FormatterType} FormatterType */
88
26
  /**
89
27
  * @typedef {Object} OutputReport
90
28
  * @property {string=} filePath
package/types/worker.d.ts CHANGED
@@ -1,63 +1,3 @@
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
- rule: import('stylelint').Rule<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
- result?: import('stylelint').PostcssResult | undefined;
53
- context?: import('stylelint').RuleContext | undefined;
54
- },
55
- callback: (warning: import('postcss').Warning) => void
56
- ) => void;
57
- };
58
- reference: {
59
- longhandSubPropertiesOfShorthandProperties: import('stylelint').LonghandSubPropertiesOfShorthandProperties;
60
- };
61
- };
62
- export type StylelintOptions = import('stylelint').LinterOptions;
1
+ export type Stylelint = import('./getStylelint').Stylelint;
2
+ export type StylelintOptions = import('./getStylelint').LinterOptions;
63
3
  export type Options = import('./options').Options;