This repository has been archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
22 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
exports.isCausedBySubstitution = (warning, line, interpolationLines) => | ||
interpolationLines.some(({ start, end }) => { | ||
if (line > start && line < end) { | ||
// Inner interpolation lines must be | ||
return true | ||
} else if (line === start) { | ||
return ['value-list-max-empty-lines', 'comment-empty-line-before'].indexOf(warning.rule) >= 0 | ||
} else if (line === end) { | ||
return ['comment-empty-line-before', 'indentation'].indexOf(warning.rule) >= 0 | ||
} else { | ||
return false | ||
} | ||
}) | ||
|
||
exports.getCorrectColumn = (taggedTemplateLocs, line, column) => { | ||
let c = column | ||
|
||
// Not consider multiple tagged literals exsit in the same line, | ||
// so we only add column offset of the first one | ||
taggedTemplateLocs.some(loc => { | ||
if (line === loc.start.line) { | ||
// Start column contains the back quote, so we need inscrese 1 | ||
c += loc.start.column + 1 - loc.wrappedOffset | ||
return true | ||
} | ||
return false | ||
}) | ||
|
||
return c | ||
} |
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
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