Skip to content

Commit

Permalink
upgrade csstree to 1.0.0-alpha.29
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed May 30, 2018
1 parent 4ebd7dd commit ef4299e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions lib/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ function validate(css, filename) {

if (message === 'Mismatch') {
message = 'Invalid value for `' + node.property + '`';
} else if (message === 'Uncomplete match') {
message = 'The rest part of value can\'t be matched to `' + node.property + '` syntax';
}

errors.push({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"dependencies": {
"clap": "^1.1.1",
"css-tree": "1.0.0-alpha.28"
"css-tree": "1.0.0-alpha.29"
},
"devDependencies": {
"eslint": "^2.13.1",
Expand Down
4 changes: 2 additions & 2 deletions test/fixture/reporter/checkstyle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<checkstyle version="4.3">
<file name="match.css">
<error line="1" column="16" severity="error" message="Invalid value for `color`" source="csstree-validator"/>
<error line="1" column="33" severity="error" message="The rest part of value can't be matched to `border` syntax" source="csstree-validator"/>
<error line="1" column="33" severity="error" message="Invalid value for `border`" source="csstree-validator"/>
<error line="1" column="46" severity="error" message="Unknown property `unknown`" source="csstree-validator"/>
</file>
<file name="parse.css">
<error line="1" column="11" severity="error" message="Colon is expected" source="csstree-validator"/>
<error line="1" column="32" severity="error" message="The rest part of value can't be matched to `color` syntax" source="csstree-validator"/>
<error line="1" column="32" severity="error" message="Invalid value for `color`" source="csstree-validator"/>
</file>
</checkstyle>
4 changes: 2 additions & 2 deletions test/fixture/reporter/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
syntax: <color>
value: 123
--------^
* The rest part of value can't be matched to `border` syntax
* Invalid value for `border`
syntax: <br-width> || <br-style> || <color>
value: 1px unknown red
------------^
* Unknown property `unknown`

# parse.css
[ERROR] CssSyntaxError: Colon is expected
* The rest part of value can't be matched to `color` syntax
* Invalid value for `color`
syntax: <color>
value: red green
------------^
4 changes: 2 additions & 2 deletions test/fixture/reporter/gnu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"match.css":1.16-1.19: error: Invalid value for `color`: `123`; allowed: <color>
"match.css":1.33-1.40: error: The rest part of value can't be matched to `border` syntax: `1px unknown red`; allowed: <br-width> || <br-style> || <color>
"match.css":1.33-1.40: error: Invalid value for `border`: `1px unknown red`; allowed: <br-width> || <br-style> || <color>
"match.css":1.46: error: Unknown property `unknown`
"parse.css":1.11: error: Colon is expected
"parse.css":1.32-1.37: error: The rest part of value can't be matched to `color` syntax: `red green`; allowed: <color>
"parse.css":1.32-1.37: error: Invalid value for `color`: `red green`; allowed: <color>
8 changes: 4 additions & 4 deletions test/fixture/reporter/json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"line": 1,
"column": 33,
"property": "border",
"message": "The rest part of value can't be matched to `border` syntax",
"details": "Uncomplete match\n syntax: <br-width> || <br-style> || <color>\n value: 1px unknown red\n ------------^"
"message": "Invalid value for `border`",
"details": "Mismatch\n syntax: <br-width> || <br-style> || <color>\n value: 1px unknown red\n ------------^"
},
{
"name": "match.css",
Expand All @@ -35,7 +35,7 @@
"line": 1,
"column": 32,
"property": "color",
"message": "The rest part of value can't be matched to `color` syntax",
"details": "Uncomplete match\n syntax: <color>\n value: red green\n ------------^"
"message": "Invalid value for `color`",
"details": "Mismatch\n syntax: <color>\n value: red green\n ------------^"
}
]
2 changes: 1 addition & 1 deletion test/loc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('locations', function() {
it('result should contain correct location of uncomplete mismatch', function() {
var error = validateString('.broken {\n border: red 1xx solid;\n}', 'test').test[0];

assert.equal(error.message, 'The rest part of value can\'t be matched to `border` syntax');
assert.equal(error.message, 'Invalid value for `border`');
assert.equal(error.line, 2);
assert.equal(error.column, 15);
assert.deepEqual(error.loc, {
Expand Down

0 comments on commit ef4299e

Please sign in to comment.