Skip to content

Commit d1c0731

Browse files
committed
Update package.json to includes the latest PrettyCSS library that includes my fix.
1 parent fffb26f commit d1c0731

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"bugs": "https://trello.com/b/ONaFg6wh/popcode",
9898
"license": "MIT",
9999
"dependencies": {
100-
"PrettyCSS": "^0.3.13",
100+
"PrettyCSS": "^0.3.15",
101101
"ajv": "^5.2.2",
102102
"array-to-sentence": "^1.1.0",
103103
"bowser": "^1.4.5",

src/validations/css/prettycss.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ const errorMap = {
5353
},
5454

5555
'extra-tokens-after-value': (error, source) => {
56-
const lineNumber = error.token.line;
56+
const errorToken = error.token;
57+
const lineNumber = errorToken.line;
5758

5859
if (lineNumber > 1) {
5960
const lines = source.split('\n');
6061
const previousLine = lines[lineNumber - 2];
6162
const thisLine = lines[lineNumber - 1];
6263

6364
if (
64-
error.token.charNum - 1 === /\S/.exec(thisLine).index &&
65+
errorToken.charNum - 1 === /\S/.exec(thisLine).index &&
6566
!endsWith(trim(previousLine), ';')
6667
) {
6768
return {
@@ -74,7 +75,7 @@ const errorMap = {
7475

7576
return ({
7677
reason: 'extra-tokens-after-value',
77-
payload: {token: error.token.content},
78+
payload: {token: errorToken.content},
7879
});
7980
},
8081

test/unit/validations/css.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ test('valid filter', validationTest(
2626
css,
2727
));
2828

29+
test('valid text-shadow declaration', validationTest(
30+
`p {
31+
text-shadow: rgba(0,0,0,0.1) 0 -5px, rgba(0,0,0,0.1) 0 -1px, \
32+
rgba(255,255,255,0.1) 1px 0, rgba(255,255,255,0.1) 0 1px, \
33+
rgba(0,0,0,0.1) -1px -1px, rgba(255,255,255,0.1) 1px 1px;
34+
}`,
35+
css,
36+
));
37+
2938
test('bogus flex value', validationTest(
3039
'.flex-item { flex: bogus; }',
3140
css,

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ JSONStream@^1.0.4:
3030
jsonparse "^1.2.0"
3131
through ">=2.2.7 <3"
3232

33-
PrettyCSS@^0.3.13:
34-
version "0.3.14"
35-
resolved "https://registry.yarnpkg.com/PrettyCSS/-/PrettyCSS-0.3.14.tgz#e71372fac131b7333af4c3f64e356e67551b9ba5"
33+
PrettyCSS@^0.3.15:
34+
version "0.3.15"
35+
resolved "https://registry.yarnpkg.com/PrettyCSS/-/PrettyCSS-0.3.15.tgz#5f7e4690b9957737972b87ce950095a762b085d3"
3636
dependencies:
37-
option-parser "~0.1.3"
37+
option-parser "~1.0.0"
3838

3939
abbrev@1:
4040
version "1.1.0"
@@ -5943,9 +5943,9 @@ optimist@>=0.3.4, optimist@^0.6.1:
59435943
minimist "~0.0.1"
59445944
wordwrap "~0.0.2"
59455945

5946-
option-parser@~0.1.3:
5947-
version "0.1.3"
5948-
resolved "https://registry.yarnpkg.com/option-parser/-/option-parser-0.1.3.tgz#cfe33c0fe95f805d9c0ac79e91224bbfa26a9c17"
5946+
option-parser@~1.0.0:
5947+
version "1.0.0"
5948+
resolved "https://registry.yarnpkg.com/option-parser/-/option-parser-1.0.0.tgz#9d470f969b7cb0cd2bb5b75e998be9961ba57206"
59495949

59505950
optionator@^0.8.1, optionator@^0.8.2:
59515951
version "0.8.2"

0 commit comments

Comments
 (0)