Skip to content

Commit 8ea8fae

Browse files
committed
output warnings if nonsense commas are included
1 parent b0774e6 commit 8ea8fae

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const creator: PluginCreator<pluginOptions> = (
8080

8181
// contains commas without meaningful tokens, such as `--negative(,)`
8282
if (nodes.length === 0) {
83+
decl.warn(result, 'Syntax error');
8384
return componentValue;
8485
}
8586

test/_tape.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ postcssTape(plugin)({
1313
'--comma-separated-list-of-component-values': () => '10px, 20px',
1414
},
1515
},
16+
warnings: 3,
1617
},
1718
});

0 commit comments

Comments
 (0)