Skip to content

Commit 1449877

Browse files
committed
wip: apply feedback
1 parent 7c68b31 commit 1449877

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/rules/no-important.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// Helpers
1919
//-----------------------------------------------------------------------------
2020

21-
const importantPattern = /(?<important>!\s*important)/diu;
21+
const importantPattern = /!\s*important/iu;
2222
const commentPattern = /\/\*[\s\S]*?\*\//gu;
2323
const trailingWhitespacePattern = /\s*$/u;
2424

@@ -58,8 +58,9 @@ export default {
5858
);
5959
const importantMatch =
6060
importantPattern.exec(textWithoutComments);
61-
const [importantStartOffset, importantEndOffset] =
62-
importantMatch.indices.groups.important;
61+
const importantStartOffset = importantMatch.index;
62+
const importantEndOffset =
63+
importantStartOffset + importantMatch[0].length;
6364
const nodeStartOffset = node.loc.start.offset;
6465

6566
context.report({

0 commit comments

Comments
 (0)