Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/rules/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,7 @@ export default createRule<Options, MessageId>({
return
}

const resolvedPath = resolve(importPath, context)

// get extension from resolved path, if possible.
// for unresolved, use source value.
const extension = path.extname(resolvedPath || importPath).slice(1)
Copy link
Member

@JounQin JounQin Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect for resolving .xyz but ./abc.js or ./abc is imported.

const extension = path.extname(importPath).slice(1)

// determine if this is a module
const isPackage =
Expand Down
Loading