Skip to content

Commit

Permalink
Fix declaration-property-value-no-unknown and other false positives…
Browse files Browse the repository at this point in the history
… for multiline SCSS interpolation (#7406)
  • Loading branch information
FloEdelmann committed Dec 18, 2023
1 parent d03def6 commit 7620c2c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-bananas-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `declaration-property-value-no-unknown` and other false positives for multiline SCSS interpolation.
Original file line number Diff line number Diff line change
Expand Up @@ -374,5 +374,15 @@ testRule({
{
code: 'a { top: #{foo}; }',
},
{
// https://github.com/stylelint/stylelint/issues/7403
code: stripIndent`
a {
top: #{
foo
};
}
`,
},
],
});
2 changes: 1 addition & 1 deletion lib/utils/hasScssInterpolation.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
'use strict';

const HAS_SCSS_INTERPOLATION = /#\{.+?\}/;
const HAS_SCSS_INTERPOLATION = /#\{.+?\}/s;

/**
* Check whether a string has scss interpolation
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/hasScssInterpolation.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const HAS_SCSS_INTERPOLATION = /#\{.+?\}/;
const HAS_SCSS_INTERPOLATION = /#\{.+?\}/s;

/**
* Check whether a string has scss interpolation
Expand Down

0 comments on commit 7620c2c

Please sign in to comment.