stylelint-webpack-plugin 3.1.0 → 3.1.1

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/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright JS Foundation and other contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- 'Software'), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright JS Foundation and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -13,6 +13,8 @@
13
13
 
14
14
  # stylelint-webpack-plugin
15
15
 
16
+ > This is stylelint-webpack-plugin 3.0 which works only with webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/stylelint-webpack-plugin/tree/2.x).
17
+
16
18
  This plugin uses [`stylelint`](https://stylelint.io/) that helps you avoid errors and enforce conventions in your styles.
17
19
 
18
20
  ## Getting Started
@@ -29,6 +31,8 @@ npm install stylelint-webpack-plugin --save-dev
29
31
  npm install stylelint --save-dev
30
32
  ```
31
33
 
34
+ **Note**: If you are using Stylelint 13 rather than 14+, you might also need to install `@types/stylelint` as a dev dependency if getting stylelint related type errors.
35
+
32
36
  Then add the plugin to your webpack config. For example:
33
37
 
34
38
  ```js
@@ -43,7 +47,7 @@ module.exports = {
43
47
 
44
48
  ## Options
45
49
 
46
- See [stylelint's options](http://stylelint.io/user-guide/node-api/#options) for the complete list of options available. These options are passed through to the `stylelint` directly.
50
+ See [stylelint's options](https://stylelint.io/user-guide/usage/node-api#options) for the complete list of options available. These options are passed through to the `stylelint` directly.
47
51
 
48
52
  ### `configFile`
49
53
 
@@ -52,7 +56,7 @@ See [stylelint's options](http://stylelint.io/user-guide/node-api/#options) for
52
56
 
53
57
  Specify the config file location to be used by `stylelint`.
54
58
 
55
- **Note:** By default this is [handled by `stylelint`](http://stylelint.io/user-guide/configuration/).
59
+ **Note:** By default this is [handled by `stylelint`](https://stylelint.io/user-guide/configure).
56
60
 
57
61
  ### `context`
58
62
 
@@ -87,14 +91,14 @@ Specify directories, files, or globs. Must be relative to `options.context`. Dir
87
91
  - Type: `Boolean`
88
92
  - Default: `false`
89
93
 
90
- If `true`, `stylelint` will fix as many errors as possible. The fixes are made to the actual source files. All unfixed errors will be reported. See [Autofixing errors](https://stylelint.io/user-guide/cli#autofixing-errors) docs.
94
+ If `true`, `stylelint` will fix as many errors as possible. The fixes are made to the actual source files. All unfixed errors will be reported. See [Autofixing errors](https://stylelint.io/user-guide/usage/options#fix) docs.
91
95
 
92
96
  ### `formatter`
93
97
 
94
98
  - Type: `String|Function`
95
99
  - Default: `'string'`
96
100
 
97
- Specify the formatter that you would like to use to format your results. See [formatter option](https://stylelint.io/user-guide/node-api#formatter).
101
+ Specify the formatter that you would like to use to format your results. See [formatter option](https://stylelint.io/user-guide/usage/options#formatter).
98
102
 
99
103
  ### `lintDirtyModulesOnly`
100
104
 
@@ -58,13 +58,12 @@ export type LintResult = import('stylelint').LintResult;
58
58
  export type Options = import('./options').Options;
59
59
  export type AsyncTask = () => Promise<void>;
60
60
  export type LintTask = (files: string | string[]) => Promise<LintResult[]>;
61
- export type Worker = JestWorker & {
62
- lintFiles: LintTask;
63
- };
64
61
  export type Linter = {
65
62
  stylelint: Stylelint;
66
63
  lintFiles: LintTask;
67
64
  cleanup: AsyncTask;
68
65
  threads: number;
69
66
  };
70
- import { Worker as JestWorker } from 'jest-worker';
67
+ export type Worker = import('jest-worker').Worker & {
68
+ lintFiles: LintTask;
69
+ };
@@ -29,10 +29,10 @@ const cache = {};
29
29
 
30
30
  /** @typedef {(files: string|string[]) => Promise<LintResult[]>} LintTask */
31
31
 
32
- /** @typedef {JestWorker & {lintFiles: LintTask}} Worker */
33
-
34
32
  /** @typedef {{stylelint: Stylelint, lintFiles: LintTask, cleanup: AsyncTask, threads: number, }} Linter */
35
33
 
34
+ /** @typedef {import('jest-worker').Worker & {lintFiles: LintTask}} Worker */
35
+
36
36
  /**
37
37
  * @param {Options} options
38
38
  * @returns {Linter}
@@ -66,11 +66,8 @@ function loadStylelintThreaded(key, poolSize, options) {
66
66
  setupArgs: [options, (0, _options.getStylelintOptions)(options)]
67
67
  };
68
68
  const local = loadStylelint(options);
69
- /** @type {Worker?} */
70
- // prettier-ignore
71
-
72
69
  let worker =
73
- /** @type {Worker} */
70
+ /** @type {Worker?} */
74
71
  new _jestWorker.Worker(source, workerOptions);
75
72
  /** @type {Linter} */
76
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-webpack-plugin",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "A Stylelint plugin for webpack",
5
5
  "license": "MIT",
6
6
  "repository": "webpack-contrib/stylelint-webpack-plugin",
@@ -46,19 +46,18 @@
46
46
  "webpack": "^5.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@types/stylelint": "^13.13.3",
50
- "globby": "^11.0.4",
51
49
  "jest-worker": "^27.3.1",
50
+ "globby": "^11.0.4",
52
51
  "micromatch": "^4.0.4",
53
52
  "normalize-path": "^3.0.0",
54
- "schema-utils": "^3.1.1"
53
+ "schema-utils": "^4.0.0"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@babel/cli": "^7.16.0",
58
57
  "@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",
58
+ "@babel/preset-env": "^7.16.4",
59
+ "@commitlint/cli": "^15.0.0",
60
+ "@commitlint/config-conventional": "^15.0.0",
62
61
  "@types/fs-extra": "^9.0.13",
63
62
  "@types/micromatch": "^4.0.2",
64
63
  "@types/normalize-path": "^3.0.0",
@@ -70,21 +69,21 @@
70
69
  "cross-env": "^7.0.3",
71
70
  "del": "^6.0.0",
72
71
  "del-cli": "^4.0.1",
73
- "eslint": "^8.1.0",
72
+ "eslint": "^8.3.0",
74
73
  "eslint-config-prettier": "^8.3.0",
75
- "eslint-plugin-import": "^2.25.2",
74
+ "eslint-plugin-import": "^2.25.3",
76
75
  "file-loader": "^6.2.0",
77
76
  "fs-extra": "^10.0.0",
78
77
  "husky": "^7.0.4",
79
78
  "jest": "^27.3.1",
80
- "lint-staged": "^11.2.6",
79
+ "lint-staged": "^12.1.2",
81
80
  "npm-run-all": "^4.1.5",
82
81
  "postcss-scss": "^4.0.2",
83
82
  "prettier": "^2.4.1",
84
83
  "standard-version": "^9.3.2",
85
- "stylelint": "^14.0.1",
86
- "typescript": "^4.4.4",
87
- "webpack": "^5.61.0"
84
+ "stylelint": "^14.1.0",
85
+ "typescript": "^4.5.2",
86
+ "webpack": "^5.64.3"
88
87
  },
89
88
  "keywords": [
90
89
  "stylelint",