Skip to content

Commit

Permalink
fix(define-macros-order): skip TSModuleDeclaration statements (#2593)
Browse files Browse the repository at this point in the history
  • Loading branch information
waynzh authored Nov 11, 2024
1 parent 50bde65 commit 4729a3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rules/define-macros-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function isUseStrictStatement(node) {
function getTargetStatementPosition(scriptSetup, program) {
const skipStatements = new Set([
'ImportDeclaration',
'TSModuleDeclaration',
'TSInterfaceDeclaration',
'TSTypeAliasDeclaration',
'DebuggerStatement',
Expand Down
2 changes: 2 additions & 0 deletions tests/lib/rules/define-macros-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ tester.run('define-macros-order', rule, {
code: `
<script setup lang="ts">
import { bar } from 'foo'
declare global {}
declare namespace Namespace {}
export interface Props {
msg?: string
labels?: string[]
Expand Down

0 comments on commit 4729a3b

Please sign in to comment.