Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
at-rule-no-unknown
end positions (#655)
This change also adds a test helper function to make testing multiline strings easier.
- Loading branch information
1 parent
0e1fa41
commit 1f153ac
Showing
4 changed files
with
83 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
const getTestRule = require("jest-preset-stylelint/getTestRule"); | ||
|
||
global.testRule = getTestRule({ plugins: ["./src"] }); | ||
|
||
// Inspired by https://www.npmjs.com/package/dedent-tag | ||
global.dedent = function dedent(strings) { | ||
return strings[0] | ||
.replace(/^[ \t]+/gm, "") // remove indentation | ||
.replace(/^\s*\n/gm, ""); // remove empty lines | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ | |
"lodash" | ||
], | ||
"globals": { | ||
"dedent": true, | ||
"testRule": true | ||
}, | ||
"rules": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters