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

fix: add package.json exports field #623

Merged
merged 1 commit into from Dec 21, 2023
Merged

fix: add package.json exports field #623

merged 1 commit into from Dec 21, 2023

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Dec 21, 2023

Fix #622.

Add exports mapping to package.json, to allow import eslintPluginRecommended from 'eslint-plugin-prettier/recommended' to work as expected.

Strictly speaking this is a breaking change as it removes the ability for people to import from "eslint-plugin-prettier/eslint-plugin-prettier.js" and "eslint-plugin-prettier/recommended.js" but the former was never a good idea in the first place and the latter has only been available for a few days, so I'm not worried about closing off those two import paths in a non-major release.

This allows users to use esm `import cfg from
'eslint-plugin-prettier/recommended'
Copy link

changeset-bot bot commented Dec 21, 2023

🦋 Changeset detected

Latest commit: 134ed69

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-prettier 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

@BPScott BPScott merged commit 8210e44 into master Dec 21, 2023
4 checks passed
@JounQin JounQin deleted the add-exports branch December 21, 2023 23:16
@JounQin
Copy link
Member

JounQin commented Dec 21, 2023

Should /recommended.js be allowed at the same time?

@BPScott
Copy link
Member Author

BPScott commented Dec 22, 2023

Should /recommended.js be allowed at the same time?

I don't think it should be. The only valid import paths for this package should be eslint-plugin-prettier and eslint-plugin-prettier/recommended

@JounQin
Copy link
Member

JounQin commented Dec 22, 2023

OK, I'm fine with this.

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.

use es6's import syntax to import eslint-plugin-prettier/recommended
2 participants