Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3c7654d

Browse filesBrowse files
committed
rename
1 parent 8b746bb commit 3c7654d
Copy full SHA for 3c7654d

File tree

1 file changed

+12
-4
lines changed
Filter options

1 file changed

+12
-4
lines changed

‎lib/rules/no-import-compiler-macros.js

Copy file name to clipboardExpand all lines: lib/rules/no-import-compiler-macros.js
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,24 @@ module.exports = {
7272
if (isOnlySpecifier) {
7373
return fixer.remove(node)
7474
} else if (isLastSpecifier) {
75-
const commaToken = sourceCode.getTokenBefore(specifier, isComma)
75+
const precedingComma = sourceCode.getTokenBefore(
76+
specifier,
77+
isComma
78+
)
7679
return fixer.removeRange([
77-
commaToken ? commaToken.range[0] : specifier.range[0],
80+
precedingComma ? precedingComma.range[0] : specifier.range[0],
7881
specifier.range[1]
7982
])
8083
} else {
81-
const commaToken = sourceCode.getTokenAfter(specifier, isComma)
84+
const subsequentComma = sourceCode.getTokenAfter(
85+
specifier,
86+
isComma
87+
)
8288
return fixer.removeRange([
8389
specifier.range[0],
84-
commaToken ? commaToken.range[1] : specifier.range[1]
90+
subsequentComma
91+
? subsequentComma.range[1]
92+
: specifier.range[1]
8593
])
8694
}
8795
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.