Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement interface version 3 #41

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Dec 3, 2024

The PR implements the new import resolver interface (un-ts/eslint-plugin-import-x#192).

Now the options hashing only happens with interface version 2.

Comment on lines 3 to 8
function createCycleSourceError(p: string) {
return {
message: `Dependency cycle via ${p}`,
messageId: 'cycleSource',
data: { source: p },
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

eslint-plugin-import-x@4.5.0 has removed all the message and has migrated them all to the messgaeId. So the error has also been updated.

if (isBuiltin(source))
return { found: true, path: null }

options ??= {}
const optionsHash = hashObject(options)
if (resolver == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With interface version 3, the resolver will not be null, so all those hashing and caching below would be skipped~

@9romise
Copy link
Owner

9romise commented Dec 3, 2024

Thanks!

@9romise 9romise merged commit 10fa0d8 into 9romise:main Dec 3, 2024
7 checks passed
@SukkaW SukkaW deleted the resolver-interface-v3 branch December 4, 2024 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants