Skip to content

Commit

Permalink
Merge pull request #262 from kristerkari/bugfix/unicode-range-and-ope…
Browse files Browse the repository at this point in the history
…rator-rules

make sure that operator* rules don't warn for unicode-range property
  • Loading branch information
kristerkari committed Jul 21, 2018
2 parents 210b5af + 1d45038 commit 0b18082
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
14 changes: 12 additions & 2 deletions src/rules/operator-no-newline-after/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ testRule(rule, {
}
`,
description: "Newline after the following op: 10px + 1\\n + 1"
},
{
code: `
@font-face {
font-family: 'Ampersand';
src: local('Times New Roman');
unicode-range: U+26;
}
`,
description: "unicode-range"
}
],

Expand Down Expand Up @@ -93,7 +103,7 @@ a {
}
<style type="text/scss">
a {
width: 10px
width: 10px
+ 1;
}
</style>
Expand All @@ -110,7 +120,7 @@ a {
}
<style type="text/scss">
a {
width: 10px +
width: 10px +
1;
}
</style>
Expand Down
12 changes: 11 additions & 1 deletion src/rules/operator-no-newline-before/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ testRule(rule, {
}
`,
description: "Custom property"
},
{
code: `
@font-face {
font-family: 'Ampersand';
src: local('Times New Roman');
unicode-range: U+26;
}
`,
description: "unicode-range"
}
],

Expand Down Expand Up @@ -96,7 +106,7 @@ testRule(rule, {
{
code: `
a {
width: 10px
width: 10px
+ 1;
}
<style type="text/scss">
Expand Down
18 changes: 14 additions & 4 deletions src/rules/operator-no-unspaced/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ testRule(rule, {
{
code: ":root { --foo: '{{}}'; }",
description: "Custom property"
},
{
code: `
@font-face {
font-family: 'Ampersand';
src: local('Times New Roman');
unicode-range: U+26;
}
`,
description: "unicode-range"
}
],

Expand Down Expand Up @@ -2204,12 +2214,12 @@ a {
reject: [
{
code: `
a {
width: 1 +$var;
a {
width: 1 +$var;
}
<style type="text/scss">
a {
width: 1 +$var;
a {
width: 1 +$var;
}
</style>
`,
Expand Down
4 changes: 4 additions & 0 deletions src/rules/operator-no-unspaced/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ export function calculationOperatorSpaceChecker({ root, result, checker }) {
}

root.walk(item => {
if (item.prop === "unicode-range") {
return;
}

let results = [];

// Check a value (`10px` in `width: 10px;`)
Expand Down

0 comments on commit 0b18082

Please sign in to comment.