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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/slimy-boats-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'eslint-plugin-prettier': patch
---

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 recommended in the first place and the latter has only been available for a few days.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"node": "^14.18.0 || >=16.0.0"
},
"main": "eslint-plugin-prettier.js",
"exports": {
".": {
"types": "./eslint-plugin-prettier.d.ts",
"default": "./eslint-plugin-prettier.js"
},
"./recommended": {
"types": "./recommended.d.ts",
"default": "./recommended.js"
}
},
"types": "eslint-plugin-prettier.d.ts",
"files": [
"eslint-plugin-prettier.d.ts",
Expand Down