Add a more descriptive message for the error generated by an empty shorthand attribute (#6217)

Added error message "empty-attribute-shorthand" for when the shorthand attribute is empty,
giving a more explicit error for #6086
pull/6314/head
Bjørn 4 years ago committed by GitHub
parent 17c5402e31
commit de6d0c66d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -330,6 +330,13 @@ function read_attribute(parser: Parser, unique_names: Set<string>) {
parser.allow_whitespace(); parser.allow_whitespace();
parser.eat('}', true); parser.eat('}', true);
if (name === null) {
parser.error({
code: 'empty-attribute-shorthand',
message: 'Attribute shorthand cannot be empty'
}, start);
}
check_unique(name); check_unique(name);
return { return {

@ -0,0 +1,10 @@
{
"code": "empty-attribute-shorthand",
"message": "Attribute shorthand cannot be empty",
"start": {
"line": 1,
"column": 6,
"character": 6
},
"pos": 6
}
Loading…
Cancel
Save