Skip to content

Commit f1cacb2

Browse files
authored
feat!: support prettier v3 (#182)
1 parent 5055759 commit f1cacb2

26 files changed

+4853
-5197
lines changed

.changeset/real-shirts-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"pretty-quick": major
3+
---
4+
5+
feat!: support prettier v3

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
strategy:
1111
matrix:
1212
node:
13-
- 10
14-
- 12
1513
- 14
1614
- 16
1715
- 18

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dist
1+
lib
22
node_modules
33
*.log
44
/.yarn/*

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
coverage
2-
dist
2+
lib
33
/.yarn

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-2.4.3.cjs

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

.yarn/releases/yarn-3.6.4.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ nodeLinker: node-modules
44

55
plugins:
66
- path: .yarn/plugins/plugin-prepare-lifecycle.cjs
7-
spec: 'https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js'
7+
spec: "https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js"
8+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
9+
spec: "@yarnpkg/plugin-interactive-tools"
810

9-
yarnPath: .yarn/releases/yarn-2.4.3.cjs
11+
yarnPath: .yarn/releases/yarn-3.6.4.cjs

__mocks__/prettier.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1+
/* eslint-disable @typescript-eslint/require-await */
2+
13
import path from 'path'
24

3-
export = {
4-
format: jest.fn((input: string) => 'formatted:' + input),
5-
resolveConfig: {
6-
sync: jest.fn((file: string) => ({ file })),
7-
},
8-
getFileInfo: {
9-
sync: jest.fn((file: string) => {
10-
const ext = path.extname(file)
11-
if (ext === '.js' || ext === '.md') {
12-
return { ignored: false, inferredParser: 'babel' }
13-
}
14-
return { ignored: false, inferredParser: null }
15-
}),
16-
},
17-
}
5+
export const format = jest.fn(async (input: string) => 'formatted:' + input)
6+
7+
export const resolveConfig = jest.fn(async (file: string) => ({ file }))
8+
9+
export const getFileInfo = jest.fn(async (file: string) => {
10+
const ext = path.extname(file)
11+
return {
12+
ignored: false,
13+
inferredParser: ext === '.js' || ext === '.md' ? 'babel' : null,
14+
}
15+
})

bin/pretty-quick.js

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

0 commit comments

Comments
 (0)