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
ESM support #487
ESM support #487
Conversation
🦋 Changeset detectedLatest commit: 20a741b 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 |
I am thinking that doesn't make sense for graphql-eslint to support ESM if eslint itself is all commonjs, and there is a couple places that the translation for esm is not straight forward: https://github.com/dotansimha/graphql-eslint/blob/master/packages/plugin/src/testkit.ts#L26 https://github.com/dotansimha/graphql-eslint/blob/master/packages/plugin/src/rules/graphql-js-validation.ts#L56 does eslint support async validation to add inline dynamic imports? In that case the solution for the current build error is to rollback the bob-the-bundler version, and add to bob-the-bundler an option to skip all the esm validation and building PS: #486 shouldn't have been merged, the CI didn't catch the building error because "yarn build" it's not in the github actions workflow |
Seems like ESLint does support ESM in some cases (like config file, see https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats and eslint/eslint#14304 ) . Not sure about parser/plugin and the rest of the features we are using. Since they are being loaded eventually by ESLint core, and we should expose code that is compatible with that. I agree that we can rollback Bob and then think of the next steps of this. What are you thoughts? @PabloSzx |
Since bob-the-bundler version was already rolled-back the next steps are allowing bob-the-bundler to skip esm building, I did a quick read of eslint core and everything is plain js with commonjs, and is unlikely that eslint will do to change to esm in the short therm considering all the current ecosystem around it, so I would simply close this issue and add the bob-the-bundler configuration to commonjs only |
Sounds good, I agree. |
Description
This is also a fix, since #486 was already merged and currently the project can't build without these changes
ESM Support
Type of change
How Has This Been Tested?
Test Environment:
@graphql-codegen/...
: latestChecklist: