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

Revert "Use ESM eslint config files" #5293

Merged
merged 4 commits into from
Jun 28, 2022

Conversation

oekazuma
Copy link
Contributor

@oekazuma oekazuma commented Jun 28, 2022

Reverts #5263

Unfortunately, this does not seem to work.

Result of running pnpm lint

Oops! Something went wrong! :(

ESLint: 8.18.0

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/Development/my-app/.eslintrc.js from /Users/Development/my-app/node_modules/.pnpm/@eslint+eslintrc@1.3.0/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported.
Instead change the require of .eslintrc.js in /Users/Development/my-app/node_modules/.pnpm/@eslint+eslintrc@1.3.0/node_modules/@eslint/eslintrc/dist/eslintrc.cjs to a dynamic import() which is available in all CommonJS modules.

@changeset-bot
Copy link

changeset-bot bot commented Jun 28, 2022

🦋 Changeset detected

Latest commit: 92ca048

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-svelte Patch

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

@Conduitry
Copy link
Member

You'd need to create a new changeset, not delete the old one, in order for this to be released properly after it's merged.

That said, can you be more specific about "does not seem to work"?

@oekazuma
Copy link
Contributor Author

I added a changeset.

The following is the result of creating a new app with npm create svelte my-app and running pnpm lint.

Oops! Something went wrong! :(

ESLint: 8.18.0

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/Development/my-app/.eslintrc.js from /Users/Development/my-app/node_modules/.pnpm/@eslint+eslintrc@1.3.0/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported.
Instead change the require of .eslintrc.js in /Users/Development/my-app/node_modules/.pnpm/@eslint+eslintrc@1.3.0/node_modules/@eslint/eslintrc/dist/eslintrc.cjs to a dynamic import() which is available in all CommonJS modules.

@avarun42
Copy link
Contributor

Can confirm and replicate. The docs also state:

JavaScript (ESM) - use .eslintrc.cjs when running ESLint in JavaScript packages that specify "type":"module" in their package.json. Note that ESLint does not support ESM configuration at this time.

Copy link
Member

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

oh goodness. I swear I tested this, but you're right and I'm seeing the same behavior. I'm not sure what happened

thanks for sending the fix

@benmccann benmccann merged commit 3607f43 into sveltejs:master Jun 28, 2022
@oekazuma oekazuma deleted the revert-5263-eslint-esm branch June 28, 2022 02:57
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.

4 participants