-
-
Notifications
You must be signed in to change notification settings - Fork 43
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 universal
export to root
#57
Conversation
Hi @SimenB!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
universal
export to rootuniversal
export to root
This was brought up during the beta period so we assumed Jest would resolve the issue before the final release came out. What’s your timeline for the fix? |
Unfortunately there’s no timeline yet for resolve, which is what jest uses currently - that doesn’t preclude jest fixing it faster. I’ve been trying to find the time for it for awhile :-/ node also keeps altering the exports field semantics, which makes it harder. |
Espree, the default parser, also uses package exports now. If we include this workaround, would we need to do the same thing in that project too? |
As Jordan mentions, Jest uses
No, since If consumers of Jest wanna use native ESM this would fall apart of course, but due to the APIs jest use in Node still being flagged (and probably will be for some time) I assume most people (by far) still use CJS (or TS/Babel compiled ESM) |
I added a comment explaining some of this in the file, which might include a non-starter - you use |
Co-authored-by: 唯然 <weiran.zsd@outlook.com>
FWIW I opened browserify/resolve#253 which might unblock Jest, but I'd still love to see this workaround land for all older versions of Jest anyways 🙂 |
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.
I’m not thrilled about including a workaround like this because we won’t be able to remove it unless we include “drop support for Jest <x.y.z” as a breaking change. It’s unusual that Jest would be part of this package’s compatibility matrix. However, we’re trying to migrate to a new config system, so we’ll eventually stop working on this package, reducing the impact of this workaround being effectively permanent. Given this is the only way for all existing Jest versions to work with ESLint v8, and there’s no timeline for support without this workaround in future versions of Jest, I think it’s best for the community that we do this.
Agreed |
Thank you! ❤️ |
* removes typescript devDependency not used at all Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com> * updates jest@27.2.5 Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com> * chore(updates devDepencencies): eslint@^8.0.0 - drops support for node 10 - adds module name mapper for jest (see eslint/eslintrc#57) BREAKING CHANGE Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com> * upgrades eslint@^8.0.1 eslint/eslint@f9217e5 Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com> * removes trailing slash on bugs link Signed-off-by: Benjamin Kroeger <benjamin.kroeger@gmail.com>
Circling back to this, Jest 28 has full support (afaik) of |
Jest doesn't support package exports (yet), so if you currently try to load
eslint
from within Jest (such as for runningruleTester
) it fails to resolve unless the user adds some config likeIt would be nice if it just worked 🙂
I very much understand if you don't wanna add this hack for Jest's lack of support for package exports, but since it's not a big burden I have some hope 👍