Skip to content

Commit 56e2e34

Browse files
authored
feat: migrate to exports field (#306)
1 parent c27e785 commit 56e2e34

File tree

7 files changed

+34
-73
lines changed

7 files changed

+34
-73
lines changed

.changeset/modern-pumpkins-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-config-prettier": minor
3+
---
4+
5+
feat: migrate to exports field

.github/workflows/check.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,3 @@ jobs:
4040

4141
- name: Prettier
4242
run: yarn prettier --check .
43-
44-
- name: Build
45-
run: yarn build

package.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,26 @@
1010
],
1111
"license": "MIT",
1212
"packageManager": "yarn@4.7.0",
13-
"bin": "build/bin/cli.js",
14-
"main": "build/index.js",
15-
"types": "build/index.d.ts",
13+
"bin": "bin/cli.js",
14+
"main": "index.js",
15+
"exports": {
16+
".": {
17+
"types": "./index.d.ts",
18+
"default": "./index.js"
19+
},
20+
"./prettier": {
21+
"types": "./prettier.d.ts",
22+
"default": "./prettier.js"
23+
},
24+
"./package.json": "./package.json"
25+
},
26+
"types": "index.d.ts",
1627
"files": [
17-
"build"
28+
"bin",
29+
"index.d.ts",
30+
"index.js",
31+
"prettier.d.ts",
32+
"prettier.js"
1833
],
1934
"keywords": [
2035
"eslint",
@@ -24,9 +39,8 @@
2439
"prettier"
2540
],
2641
"scripts": {
27-
"build": "node scripts/build.js",
2842
"prettier": "prettier --write .",
29-
"release": "yarn build && clean-pkg-json && changeset publish",
43+
"release": "clean-pkg-json && changeset publish",
3044
"test": "yarn test:prettier && ESLINT_CONFIG_PRETTIER_NO_DEPRECATED=true yarn test:with-env && ESLINT_USE_FLAT_CONFIG=false yarn test:with-env && yarn build",
3145
"test:cli-sanity": "node ./bin/cli.js index.js",
3246
"test:cli-sanity-warning": "node ./bin/cli.js react.js ./bin/cli.js",

prettier.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const rules: Record<string, 0>;

prettier.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
"use strict";
22

3-
module.exports = {
4-
rules: {
5-
// These are safe to use as long as the `"prettier/prettier"` rule from
6-
// eslint-plugin-prettier isn’t enabled.
7-
// These are also included in `"plugin:prettier/recommended"`:
8-
// https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
9-
"arrow-body-style": 0,
10-
"prefer-arrow-callback": 0,
11-
},
3+
exports.rules = {
4+
// These are safe to use as long as the `"prettier/prettier"` rule from
5+
// eslint-plugin-prettier isn’t enabled.
6+
// These are also included in `"plugin:prettier/recommended"`:
7+
// https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
8+
"arrow-body-style": 0,
9+
"prefer-arrow-callback": 0,
1210
};

scripts/build.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ __metadata:
27032703
peerDependencies:
27042704
eslint: ">=7.0.0"
27052705
bin:
2706-
eslint-config-prettier: build/bin/cli.js
2706+
eslint-config-prettier: bin/cli.js
27072707
languageName: unknown
27082708
linkType: soft
27092709

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy