Skip to content

Commit

Permalink
fix: Match non-Latin characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Mar 11, 2021
1 parent 5635029 commit 9a7411a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/rules/no-commented-out-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ const rule = ruleCreator({
});

function isUnintentionallyParsable(content: string) {
return /^\s*$/.test(content) || /^\s*[a-z]+(:\s*[a-z]+)?\s*$/i.test(content);
// https://stackoverflow.com/a/2008444/6680611
return (
/^\s*$/.test(content) ||
/^\s*[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(:\s*[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*$/i.test(
content
)
);
}

function toBlocks(comments: es.Comment[]) {
Expand Down

0 comments on commit 9a7411a

Please sign in to comment.