-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: add languageOptions to ChildContext #85
fix: add languageOptions to ChildContext #85
Conversation
🦋 Changeset detectedLatest commit: 4ece153 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
I extracted the logic of creating the context cache key into a separate function, and also made a function for obtaining a hash for options with its caching (since adding 2 more global variables for |
This pr seems similar with import-js#2829 but with additional cache and both should fix |
* fix `Parse errors in imported module '': parserPath or languageOptions.parser is required!`: un-ts/eslint-plugin-import-x#85 (comment) @ eslint.config.js * re-plug eslint: pzmosquito/eslint-import-resolver-vite#12 (comment) @ package.json * fix some violations of eslint rules @ fe
…ache and use dequal instead of JSON.stringify
Refactored a bit context hashing:
A little more on the second point: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kosmotema I noticed that a few tests were not passed and CI failed. I am blocking the PR for now.
75f7705
to
4ece153
Compare
Found and fixed the bug that causes this test to fail. For some reason I thought before that Also decided to switch from |
This reminds me of a package https://www.npmjs.com/package/stable-hash that does exactly that, IMHO we can use this package instead of self implementing this! |
Currently the plugin loses
languageOptions
when creating a child context (when using a flat config). This causes errors when plugin tries to use the default parser, i.e.languageOptions.parser
I've also created a reproduction for this bug