Skip to content

Commit 5d325b5

Browse files
authored
Use dprint's prettier plugin: identical formatting; faster thanks to incremental caching (#1722)
* initial commit * switch config to dprint prettier plugin; its faster cuz of incremental mode * update justfile * remove prettier ignorefile * fix * npm lockfile
1 parent deef947 commit 5d325b5

File tree

5 files changed

+47
-34
lines changed

5 files changed

+47
-34
lines changed

.prettierignore

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

dprint.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"incremental": true,
3+
"lineWidth": 80,
4+
"prettier": {
5+
"associations": [
6+
"**/*.{ts,tsx,js,mjs,cjs,jsx,json,md}"
7+
],
8+
"singleQuote": true
9+
},
10+
// Run `dprint output-file-paths` to see which files are being matched
11+
"includes": [
12+
"/*.{js,mjs}",
13+
"/esm/**",
14+
"/register/**",
15+
"/scripts/**",
16+
"/src/**",
17+
"/tests/**",
18+
"/website/**"
19+
],
20+
"excludes": [
21+
"/website/.docusaurus",
22+
"/website/build",
23+
"/website/docs",
24+
"/website/readme-sources",
25+
"/website/static",
26+
"tests/main-realpath/symlink/tsconfig.json",
27+
"tests/throw error.ts",
28+
"tests/throw error react tsx.tsx",
29+
"tests/esm/throw error.ts",
30+
"tests/legacy-source-map-support-interop/index.ts",
31+
"tests/main-realpath/symlink/symlink.tsx"
32+
],
33+
"plugins": [
34+
"https://plugins.dprint.dev/prettier-0.6.2.exe-plugin@36dd4f8b9710ab323c471017ecd00a20cf1dca2728c12242c7dabb8dfacad0e2"
35+
]
36+
}

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ install:
2727
# CUT
2828

2929
lint *ARGS:
30-
prettier --check . "$@"
30+
dprint check "$@"
3131
lint-fix *ARGS:
32-
prettier --write . "$@"
32+
dprint fmt "$@"
3333
clean *ARGS:
3434
rimraf dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz "$@"
3535
rebuild *ARGS:

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"/node16/"
6262
],
6363
"scripts": {
64-
"lint": "prettier --check .",
65-
"lint-fix": "prettier --loglevel warn --write .",
64+
"lint": "dprint check",
65+
"lint-fix": "dprint fmt",
6666
"clean": "rimraf dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz",
6767
"rebuild": "npm run clean && npm run build",
6868
"build": "npm run build-nopack && npm run build-pack",
@@ -127,12 +127,12 @@
127127
"ava": "^3.15.0",
128128
"axios": "^0.21.1",
129129
"chai": "^4.0.1",
130+
"dprint": "^0.25.0",
130131
"expect": "^27.0.2",
131132
"get-stream": "^6.0.0",
132133
"lodash": "^4.17.15",
133134
"ntypescript": "^1.201507091536.1",
134135
"nyc": "^15.0.1",
135-
"prettier": "^2.5.1",
136136
"proper-lockfile": "^4.1.2",
137137
"proxyquire": "^2.0.0",
138138
"react": "^16.14.0",
@@ -173,9 +173,6 @@
173173
"v8-compile-cache-lib": "^3.0.1",
174174
"yn": "3.1.1"
175175
},
176-
"prettier": {
177-
"singleQuote": true
178-
},
179176
"volta": {
180177
"node": "17.5.0",
181178
"npm": "6.14.15"

0 commit comments

Comments
 (0)