Skip to content

Commit 65e4fc0

Browse files
authoredJul 17, 2019
feat: improved validation error messages
1 parent 9c32885 commit 65e4fc0

9 files changed

+1175
-840
lines changed
 

Diff for: ‎.github/CONTRIBUTING.md

+8
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ module. Thankfully, Github provides a means to do this. Add a dependency to the
147147

148148
Where `{id}` is the # ID of your Pull Request.
149149

150+
## Contributor License Agreement
151+
152+
When submitting your contribution, a CLA (Contributor License Agreement) bot will come by to verify that you signed the [CLA](https://cla.js.foundation/webpack-contrib/css-loader).
153+
If it is your first time, it will link you to the right place to sign it.
154+
However, if you have committed your contributions using an email that is not the same as your email used on GitHub, the CLA bot can't accept your contribution.
155+
156+
Run `git config user.email` to see your Git email, and verify it with [your GitHub email](https://github.com/settings/emails).
157+
150158
## Thanks
151159

152160
For your interest, time, understanding, and for following this simple guide.

Diff for: ‎README.md

+26-15
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,22 @@ module.exports = {
109109

110110
## Options
111111

112-
| Name | Type | Default | Description |
113-
| :-----------------------------------------: | :-------------------------: | :-----: | :------------------------------------------------- |
114-
| **[`url`](#url)** | `{Boolean\|Function}` | `true` | Enable/Disable `url()` handling |
115-
| **[`import`](#import)** | `{Boolean\|Function}` | `true` | Enable/Disable @import handling |
116-
| **[`modules`](#modules)** | `{Boolean\|String\|Object}` | `false` | Enable/Disable CSS Modules and setup their options |
117-
| **[`sourceMap`](#sourcemap)** | `{Boolean}` | `false` | Enable/Disable Sourcemaps |
118-
| **[`importLoaders`](#importloaders)** | `{Number}` | `0` | Number of loaders applied before CSS loader |
119-
| **[`localsConvention`](#localsconvention)** | `{String}` | `asIs` | Setup style of exported classnames |
120-
| **[`onlyLocals`](#onlylocals)** | `{Boolean}` | `false` | Export only locals |
112+
| Name | Type | Default | Description |
113+
| :-----------------------------------------: | :-------------------------: | :-----: | :--------------------------------------------------------------------- |
114+
| **[`url`](#url)** | `{Boolean\|Function}` | `true` | Enables/Disables `url`/`image-set` functions handling |
115+
| **[`import`](#import)** | `{Boolean\|Function}` | `true` | Enables/Disables `@import` at-rules handling |
116+
| **[`modules`](#modules)** | `{Boolean\|String\|Object}` | `false` | Enables/Disables CSS Modules and their configuration |
117+
| **[`sourceMap`](#sourcemap)** | `{Boolean}` | `false` | Enables/Disables generation of source maps |
118+
| **[`importLoaders`](#importloaders)** | `{Number}` | `0` | Enables/Disables or setups number of loaders applied before CSS loader |
119+
| **[`localsConvention`](#localsconvention)** | `{String}` | `asIs` | Style of exported classnames |
120+
| **[`onlyLocals`](#onlylocals)** | `{Boolean}` | `false` | Export only locals |
121121

122122
### `url`
123123

124124
Type: `Boolean|Function`
125125
Default: `true`
126126

127+
Enables/Disables `url`/`image-set` functions handling.
127128
Control `url()` resolving. Absolute URLs and root-relative URLs are not resolving.
128129

129130
Examples resolutions:
@@ -203,6 +204,7 @@ module.exports = {
203204
Type: `Boolean`
204205
Default: `true`
205206

207+
Enables/Disables `@import` at-rules handling.
206208
Control `@import` resolving. Absolute urls in `@import` will be moved in runtime code.
207209

208210
Examples resolutions:
@@ -285,6 +287,8 @@ module.exports = {
285287
Type: `Boolean|String|Object`
286288
Default: `false`
287289

290+
Enables/Disables CSS Modules and their configuration.
291+
288292
The `modules` option enables/disables the **[CSS Modules](https://github.com/css-modules/css-modules)** specification and setup basic behaviour.
289293

290294
Using `false` value increase performance because we avoid parsing **CSS Modules** features, it will be useful for developers who use vanilla css or use other technologies.
@@ -703,14 +707,12 @@ module.exports = {
703707
Type: `Boolean`
704708
Default: `false`
705709

706-
To include source maps set the `sourceMap` option.
710+
Enables/Disables generation of source maps.
707711

708-
I.e. the `mini-css-extract-plugin` can handle them.
712+
To include source maps set the `sourceMap` option.
709713

710714
They are not enabled by default because they expose a runtime overhead and increase in bundle size (JS source maps do not).
711715

712-
In addition to that relative paths are buggy and you need to use an absolute public path which includes the server URL.
713-
714716
**webpack.config.js**
715717

716718
```js
@@ -734,6 +736,8 @@ module.exports = {
734736
Type: `Number`
735737
Default: `0`
736738

739+
Enables/Disables or setups number of loaders applied before CSS loader.
740+
737741
The option `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@import`ed resources.
738742

739743
**webpack.config.js**
@@ -749,7 +753,10 @@ module.exports = {
749753
{
750754
loader: 'css-loader',
751755
options: {
752-
importLoaders: 2, // 0 => no loaders (default); 1 => postcss-loader; 2 => postcss-loader, sass-loader
756+
importLoaders: 2,
757+
// 0 => no loaders (default);
758+
// 1 => postcss-loader;
759+
// 2 => postcss-loader, sass-loader
753760
},
754761
},
755762
'postcss-loader',
@@ -768,6 +775,8 @@ This may change in the future when the module system (i. e. webpack) supports lo
768775
Type: `String`
769776
Default: `undefined`
770777

778+
Style of exported classnames.
779+
771780
By default, the exported JSON keys mirror the class names (i.e `asIs` value).
772781

773782
| Name | Type | Description |
@@ -814,7 +823,9 @@ module.exports = {
814823
Type: `Boolean`
815824
Default: `false`
816825

817-
Export only locals (**useful** when you use **css modules**).
826+
Export only locals.
827+
828+
**Useful** when you use **css modules** for pre-rendering (for example SSR).
818829
For pre-rendering with `mini-css-extract-plugin` you should use this option instead of `style-loader!css-loader` **in the pre-rendering bundle**.
819830
It doesn't embed CSS but only exports the identifier mappings.
820831

Diff for: ‎lint-staged.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
module.exports = {
2-
ignore: ['package-lock.json', 'CHANGELOG.md'],
3-
linters: {
4-
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
5-
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
6-
},
2+
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
3+
'*.{json,md,yml,css}': ['prettier --write', 'git add'],
74
};

Diff for: ‎package-lock.json

+1,009-669
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -52,36 +52,36 @@
5252
"postcss-modules-scope": "^2.1.0",
5353
"postcss-modules-values": "^3.0.0",
5454
"postcss-value-parser": "^4.0.0",
55-
"schema-utils": "^1.0.0"
55+
"schema-utils": "^2.0.0"
5656
},
5757
"devDependencies": {
58-
"@babel/cli": "^7.4.4",
59-
"@babel/core": "^7.4.5",
60-
"@babel/preset-env": "^7.4.5",
61-
"@commitlint/cli": "^8.0.0",
62-
"@commitlint/config-conventional": "^8.0.0",
63-
"@webpack-contrib/defaults": "^5.0.0",
58+
"@babel/cli": "^7.5.0",
59+
"@babel/core": "^7.5.4",
60+
"@babel/preset-env": "^7.5.4",
61+
"@commitlint/cli": "^8.1.0",
62+
"@commitlint/config-conventional": "^8.1.0",
63+
"@webpack-contrib/defaults": "^5.0.2",
6464
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
6565
"babel-jest": "^24.8.0",
6666
"commitlint-azure-pipelines-cli": "^1.0.2",
6767
"cross-env": "^5.2.0",
68-
"del": "^4.1.1",
68+
"del": "^5.0.0",
6969
"del-cli": "^2.0.0",
7070
"es-check": "^5.0.0",
7171
"eslint": "^5.16.0",
72-
"eslint-config-prettier": "^4.3.0",
73-
"eslint-plugin-import": "^2.17.3",
72+
"eslint-config-prettier": "^6.0.0",
73+
"eslint-plugin-import": "^2.18.0",
7474
"file-loader": "^4.0.0",
75-
"husky": "^2.4.0",
75+
"husky": "^3.0.0",
7676
"jest": "^24.8.0",
7777
"jest-junit": "^6.4.0",
78-
"lint-staged": "^8.2.0",
78+
"lint-staged": "^9.2.0",
7979
"memory-fs": "^0.4.1",
8080
"npm-run-all": "^4.1.5",
8181
"postcss-loader": "^3.0.0",
82-
"postcss-preset-env": "^6.6.0",
82+
"postcss-preset-env": "^6.7.0",
8383
"prettier": "^1.18.2",
84-
"sass": "^1.21.0",
84+
"sass": "^1.22.5",
8585
"sass-loader": "^7.1.0",
8686
"standard-version": "^6.0.1",
8787
"strip-ansi": "^5.2.0",

Diff for: ‎src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ import CssSyntaxError from './CssSyntaxError';
3232
export default function loader(content, map, meta) {
3333
const options = getOptions(this) || {};
3434

35-
validateOptions(schema, options, 'CSS Loader');
35+
validateOptions(schema, options, {
36+
name: 'CSS Loader',
37+
baseDataPath: 'options',
38+
});
3639

3740
const callback = this.async();
3841
const sourceMap = options.sourceMap || false;

Diff for: ‎src/options.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"additionalProperties": false,
33
"properties": {
44
"url": {
5+
"description": "Enables/Disables 'url'/'image-set' functions handling (https://github.com/webpack-contrib/css-loader#url).",
56
"anyOf": [
67
{
78
"type": "boolean"
@@ -12,6 +13,7 @@
1213
]
1314
},
1415
"import": {
16+
"description": "Enables/Disables '@import' at-rules handling (https://github.com/webpack-contrib/css-loader#import).",
1517
"anyOf": [
1618
{
1719
"type": "boolean"
@@ -22,20 +24,19 @@
2224
]
2325
},
2426
"modules": {
27+
"description": "Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).",
2528
"anyOf": [
2629
{
2730
"type": "boolean"
2831
},
2932
{
30-
"type": "string",
3133
"enum": ["local", "global"]
3234
},
3335
{
3436
"type": "object",
3537
"additionalProperties": false,
3638
"properties": {
3739
"mode": {
38-
"type": "string",
3940
"enum": ["local", "global"]
4041
},
4142
"localIdentName": {
@@ -72,9 +73,11 @@
7273
]
7374
},
7475
"sourceMap": {
76+
"description": "Enables/Disables generation of source maps (https://github.com/webpack-contrib/css-loader#sourcemap).",
7577
"type": "boolean"
7678
},
7779
"importLoaders": {
80+
"description": "Enables/Disables or setups number of loaders applied before CSS loader (https://github.com/webpack-contrib/css-loader#importloaders).",
7881
"anyOf": [
7982
{
8083
"type": "boolean"
@@ -85,14 +88,11 @@
8588
]
8689
},
8790
"localsConvention": {
88-
"anyOf": [
89-
{
90-
"type": "string",
91-
"enum": ["asIs", "camelCase", "camelCaseOnly", "dashes", "dashesOnly"]
92-
}
93-
]
91+
"description": "Style of exported classnames (https://github.com/webpack-contrib/css-loader#localsconvention).",
92+
"enum": ["asIs", "camelCase", "camelCaseOnly", "dashes", "dashesOnly"]
9493
},
9594
"onlyLocals": {
95+
"description": "Export only locals (https://github.com/webpack-contrib/css-loader#onlylocals).",
9696
"type": "boolean"
9797
}
9898
},

Diff for: ‎test/__snapshots__/validate-options.test.js.snap

+102-128
Original file line numberDiff line numberDiff line change
@@ -1,184 +1,158 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`validate options 1`] = `
4-
"CSS Loader Invalid Options
5-
6-
options.url should be boolean
7-
options.url should pass \\"instanceof\\" keyword validation
8-
options.url should match some schema in anyOf
9-
"
4+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
5+
- options.url should be one of these:
6+
boolean | function
7+
-> Enables/Disables 'url'/'image-set' functions handling (https://github.com/webpack-contrib/css-loader#url).
8+
Details:
9+
* options.url should be a boolean.
10+
* options.url should be an instance of function."
1011
`;
1112

1213
exports[`validate options 2`] = `
13-
"CSS Loader Invalid Options
14-
15-
options.import should be boolean
16-
options.import should pass \\"instanceof\\" keyword validation
17-
options.import should match some schema in anyOf
18-
"
14+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
15+
- options.import should be one of these:
16+
boolean | function
17+
-> Enables/Disables '@import' at-rules handling (https://github.com/webpack-contrib/css-loader#import).
18+
Details:
19+
* options.import should be a boolean.
20+
* options.import should be an instance of function."
1921
`;
2022

2123
exports[`validate options 3`] = `
22-
"CSS Loader Invalid Options
23-
24-
options.modules should be boolean
25-
options.modules should be equal to one of the allowed values
26-
options.modules should be object
27-
options.modules should match some schema in anyOf
28-
"
24+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
25+
- options.modules should be one of these:
26+
boolean | \\"local\\" | \\"global\\" | object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
27+
-> Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).
28+
Details:
29+
* options.modules should be a boolean.
30+
* options.modules should be one of these:
31+
\\"local\\" | \\"global\\"
32+
* options.modules should be an object:
33+
object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }"
2934
`;
3035
3136
exports[`validate options 4`] = `
32-
"CSS Loader Invalid Options
33-
34-
options.modules should be boolean
35-
options.modules should be equal to one of the allowed values
36-
options.modules should be object
37-
options.modules should match some schema in anyOf
38-
"
37+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
38+
- options.modules should be one of these:
39+
boolean | \\"local\\" | \\"global\\" | object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
40+
-> Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).
41+
Details:
42+
* options.modules should be a boolean.
43+
* options.modules should be one of these:
44+
\\"local\\" | \\"global\\"
45+
* options.modules should be an object:
46+
object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }"
3947
`;
4048
4149
exports[`validate options 5`] = `
42-
"CSS Loader Invalid Options
43-
44-
options.modules should be boolean
45-
options.modules should be equal to one of the allowed values
46-
options.modules should be object
47-
options.modules should match some schema in anyOf
48-
"
50+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
51+
- options.modules should be one of these:
52+
boolean | \\"local\\" | \\"global\\" | object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
53+
-> Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).
54+
Details:
55+
* options.modules should be a boolean.
56+
* options.modules should be one of these:
57+
\\"local\\" | \\"global\\"
58+
* options.modules should be an object:
59+
object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }"
4960
`;
5061
5162
exports[`validate options 6`] = `
52-
"CSS Loader Invalid Options
53-
54-
options.modules should be boolean
55-
options.modules should be string
56-
options.modules should be equal to one of the allowed values
57-
options.modules.mode should be string
58-
options.modules.mode should be equal to one of the allowed values
59-
options.modules should match some schema in anyOf
60-
"
63+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
64+
- options.modules.mode should be one of these:
65+
\\"local\\" | \\"global\\""
6166
`;
6267
6368
exports[`validate options 7`] = `
64-
"CSS Loader Invalid Options
65-
66-
options.modules should be boolean
67-
options.modules should be string
68-
options.modules should be equal to one of the allowed values
69-
options.modules.mode should be equal to one of the allowed values
70-
options.modules should match some schema in anyOf
71-
"
69+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
70+
- options.modules.mode should be one of these:
71+
\\"local\\" | \\"global\\""
7272
`;
7373
7474
exports[`validate options 8`] = `
75-
"CSS Loader Invalid Options
76-
77-
options.modules should be boolean
78-
options.modules should be string
79-
options.modules should be equal to one of the allowed values
80-
options.modules.mode should be equal to one of the allowed values
81-
options.modules should match some schema in anyOf
82-
"
75+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
76+
- options.modules.mode should be one of these:
77+
\\"local\\" | \\"global\\""
8378
`;
8479
8580
exports[`validate options 9`] = `
86-
"CSS Loader Invalid Options
87-
88-
options.modules should be boolean
89-
options.modules should be string
90-
options.modules should be equal to one of the allowed values
91-
options.modules.mode should be equal to one of the allowed values
92-
options.modules should match some schema in anyOf
93-
"
81+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
82+
- options.modules.mode should be one of these:
83+
\\"local\\" | \\"global\\""
9484
`;
9585
9686
exports[`validate options 10`] = `
97-
"CSS Loader Invalid Options
98-
99-
options.modules should be boolean
100-
options.modules should be string
101-
options.modules should be equal to one of the allowed values
102-
options.modules.localIdentName should be string
103-
options.modules should match some schema in anyOf
104-
"
87+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
88+
- options.modules.localIdentName should be a string."
10589
`;
10690
10791
exports[`validate options 11`] = `
108-
"CSS Loader Invalid Options
109-
110-
options.modules should be boolean
111-
options.modules should be string
112-
options.modules should be equal to one of the allowed values
113-
options.modules.context should be string
114-
options.modules should match some schema in anyOf
115-
"
92+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
93+
- options.modules.context should be a string."
11694
`;
11795
11896
exports[`validate options 12`] = `
119-
"CSS Loader Invalid Options
120-
121-
options.modules should be boolean
122-
options.modules should be string
123-
options.modules should be equal to one of the allowed values
124-
options.modules.hashPrefix should be string
125-
options.modules should match some schema in anyOf
126-
"
97+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
98+
- options.modules.hashPrefix should be a string."
12799
`;
128100
129101
exports[`validate options 13`] = `
130-
"CSS Loader Invalid Options
131-
132-
options.modules should be boolean
133-
options.modules should be string
134-
options.modules should be equal to one of the allowed values
135-
options.modules.getLocalIdent should be boolean
136-
options.modules.getLocalIdent should pass \\"instanceof\\" keyword validation
137-
options.modules.getLocalIdent should match some schema in anyOf
138-
options.modules should match some schema in anyOf
139-
"
102+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
103+
- options.modules should be one of these:
104+
boolean | \\"local\\" | \\"global\\" | object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
105+
-> Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).
106+
Details:
107+
* options.modules.getLocalIdent should be a boolean.
108+
* options.modules.getLocalIdent should be an instance of function.
109+
* options.modules.getLocalIdent should be one of these:
110+
boolean | function"
140111
`;
141112
142113
exports[`validate options 14`] = `
143-
"CSS Loader Invalid Options
144-
145-
options.modules should be boolean
146-
options.modules should be string
147-
options.modules should be equal to one of the allowed values
148-
options.modules.localIdentRegExp should be string
149-
options.modules.localIdentRegExp should pass \\"instanceof\\" keyword validation
150-
options.modules.localIdentRegExp should match some schema in anyOf
151-
options.modules should match some schema in anyOf
152-
"
114+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
115+
- options.modules should be one of these:
116+
boolean | \\"local\\" | \\"global\\" | object { mode?, localIdentName?, localIdentRegExp?, context?, hashPrefix?, getLocalIdent? }
117+
-> Enables/Disables CSS Modules and their configuration (https://github.com/webpack-contrib/css-loader#modules).
118+
Details:
119+
* options.modules.localIdentRegExp should be a string.
120+
* options.modules.localIdentRegExp should be an instance of RegExp.
121+
* options.modules.localIdentRegExp should be one of these:
122+
string | RegExp"
153123
`;
154124
155125
exports[`validate options 15`] = `
156-
"CSS Loader Invalid Options
157-
158-
options.sourceMap should be boolean
159-
"
126+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
127+
- options.sourceMap should be a boolean.
128+
-> Enables/Disables generation of source maps (https://github.com/webpack-contrib/css-loader#sourcemap)."
160129
`;
161130
162131
exports[`validate options 16`] = `
163-
"CSS Loader Invalid Options
164-
165-
options.localsConvention should be equal to one of the allowed values
166-
options.localsConvention should match some schema in anyOf
167-
"
132+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
133+
- options.localsConvention should be one of these:
134+
\\"asIs\\" | \\"camelCase\\" | \\"camelCaseOnly\\" | \\"dashes\\" | \\"dashesOnly\\"
135+
-> Style of exported classnames (https://github.com/webpack-contrib/css-loader#localsconvention)."
168136
`;
169137
170138
exports[`validate options 17`] = `
171-
"CSS Loader Invalid Options
172-
173-
options.importLoaders should be boolean
174-
options.importLoaders should be number
175-
options.importLoaders should match some schema in anyOf
176-
"
139+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
140+
- options.importLoaders should be one of these:
141+
boolean | number
142+
-> Enables/Disables or setups number of loaders applied before CSS loader (https://github.com/webpack-contrib/css-loader#importloaders).
143+
Details:
144+
* options.importLoaders should be a boolean.
145+
* options.importLoaders should be a number."
177146
`;
178147
179148
exports[`validate options 18`] = `
180-
"CSS Loader Invalid Options
149+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
150+
- options.onlyLocals should be a boolean.
151+
-> Export only locals (https://github.com/webpack-contrib/css-loader#onlylocals)."
152+
`;
181153
182-
options.onlyLocals should be boolean
183-
"
154+
exports[`validate options 19`] = `
155+
"Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema.
156+
- options has an unknown property 'unknown'. These properties are valid:
157+
object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals? }"
184158
`;

Diff for: ‎test/validate-options.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,6 @@ it('validate options', () => {
110110
expect(() => validate({ onlyLocals: true })).not.toThrow();
111111
expect(() => validate({ onlyLocals: false })).not.toThrow();
112112
expect(() => validate({ onlyLocals: 'true' })).toThrowErrorMatchingSnapshot();
113+
114+
expect(() => validate({ unknown: 'unknown' })).toThrowErrorMatchingSnapshot();
113115
});

0 commit comments

Comments
 (0)
Please sign in to comment.