Skip to content

Commit c36429b

Browse files
committed
Change order and newline-after-import to exclude "export import"s only
1 parent a38d6ad commit c36429b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/rules/newline-after-import.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ after ${type} statement not followed by another ${type}.`,
120120
const nodePosition = parent.body.indexOf(node)
121121
const nextNode = parent.body[nodePosition + 1]
122122

123-
// skip object imports
124-
if (node.type === 'TSImportEqualsDeclaration' &&
125-
(!node.moduleReference || node.moduleReference.type !== 'TSExternalModuleReference')) {
123+
// skip "export import"s
124+
if (node.type === 'TSImportEqualsDeclaration' && node.isExport) {
126125
return
127126
}
128127

src/rules/order.js

+4
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,10 @@ module.exports = {
615615
TSImportEqualsDeclaration: function handleImports(node) {
616616
let name
617617
let type
618+
// skip "export import"s
619+
if (node.isExport) {
620+
return
621+
}
618622
if (node.moduleReference.type === 'TSExternalModuleReference') {
619623
name = node.moduleReference.expression.value
620624
type = 'import'

0 commit comments

Comments
 (0)