Skip to content

Commit 41fe336

Browse files
authored
fix: use synckit to support Prettier 3 (#199)
1 parent 5c6b2e6 commit 41fe336

15 files changed

+1510
-1953
lines changed

.all-contributorsrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,25 @@
4343
"contributions": [
4444
"doc"
4545
]
46+
},
47+
{
48+
"login": "JounQin",
49+
"name": "JounQin",
50+
"avatar_url": "https://avatars.githubusercontent.com/u/8336744?v=4",
51+
"profile": "https://www.1stg.me/",
52+
"contributions": [
53+
"code",
54+
"review"
55+
]
56+
},
57+
{
58+
"login": "netux",
59+
"name": "Martín Rodríguez",
60+
"avatar_url": "https://avatars.githubusercontent.com/u/6181929?v=4",
61+
"profile": "https://netux.site/",
62+
"contributions": [
63+
"code"
64+
]
4665
}
4766
],
4867
"contributorsPerLine": 7

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Test
22

33
on:
44
push:
5-
branches: ['master']
5+
branches: ["master"]
66
pull_request:
7-
branches: ['master']
7+
branches: ["master"]
88

99
jobs:
1010
build:
1111
strategy:
1212
matrix:
1313
# os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
14-
os: ['ubuntu-latest']
14+
os: ["ubuntu-latest"]
1515

1616
runs-on: ${{ matrix.os }}
1717

@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/setup-node@v3
2121
with:
2222
node-version: 16.x
23-
cache: 'yarn'
23+
cache: "yarn"
2424
- run: yarn install --frozen-lockfile
2525
- run: yarn build
2626
- run: xvfb-run -a yarn test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
test/fixtures/temp
66
coverage/
77
.env
8+
/*.vsix

.gitlab-ci.yml

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

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# v6.0.0 (Fri Dec 1 2023)
2+
3+
#### 🚀 Enhancement
4+
5+
- fix: use `worker_threads` via [`synckit`](https://github.com/un-ts/synckit) to support Prettier 3
6+
7+
#### ⚠️ Breaking Changes
8+
- `prettier-eslint` is no longer bundled with the extension and must be installed by the user
9+
- Prettier v3.0 is now required
10+
- ESLint >= v8.52.0 is now required
11+
112
# v5.1.0 (Fri Mar 10 2023)
213

314
:tada: This release contains work from a new contributor! :tada:

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<img src="https://github.com/idahogurl/vs-code-prettier-eslint/blob/master/icon.png?raw=true" width="150">
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4-
5-
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
6-
4+
[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
75
<!-- ALL-CONTRIBUTORS-BADGE:END -->
86

97
# [VS Code Prettier ESLint](https://marketplace.visualstudio.com/items?itemName=rvest.vs-code-prettier-eslint)
@@ -22,8 +20,9 @@ A Visual Studio Code Extension to format JavaScript and TypeScript code using th
2220

2321
This extension requires the following NPM packages to be installed either locally or globally:
2422

25-
- `prettier@^2.5.1`
26-
- `eslint@^8.7.0`
23+
- `prettier@^3.1.0`
24+
- `eslint@^8.52.0`
25+
- `prettier-eslint@^16.1.2`
2726
- `@typescript-eslint/parser@^5.0.1` and `typescript@^4.4.4` **(Only for TypeScript projects)**
2827
- `vue-eslint-parser@^8.0.0` **(Only for Vue projects)**
2928

@@ -41,24 +40,24 @@ This extension requires the following NPM packages to be installed either locall
4140

4241
### Install Dependencies
4342

44-
First we need to install `prettier` and `eslint` as dev dependencies in your project. Run one of the following commands based on your project requirements. The commands listed below use `yarn` but you can also use `npm`. Just replace `yarn add` with `npm i`
43+
First we need to install `prettier`, `eslint`, and `prettier-eslint` as dev dependencies in your project. Run one of the following commands based on your project requirements. The commands listed below use `yarn` but you can also use `npm`. Just replace `yarn add` with `npm i`
4544

4645
#### Minimum Requirements
4746

4847
```bash
49-
yarn add -D prettier@^2.5.1 eslint@^8.7.0
48+
yarn add -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2
5049
```
5150

5251
#### TypeScript Projects
5352

5453
```bash
55-
yarn add -D prettier@^2.5.1 eslint@^8.7.0 @typescript-eslint/parser@^5.0.1 typescript@^4.4.4
54+
yarn add -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2 @typescript-eslint/parser@^5.0.1 typescript@^4.4.4
5655
```
5756

5857
#### Vue Projects
5958

6059
```bash
61-
yarn add -D prettier@^2.5.1 eslint@^8.7.0 vue-eslint-parser@^8.0.0
60+
yarn add -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2 vue-eslint-parser@^8.0.0
6261
```
6362

6463
### Project Settings
@@ -146,9 +145,10 @@ These projects are setup to work with the VS Code Prettier ESLint extension. Use
146145

147146
## Support for Earlier Versions
148147

149-
- Prettier 1.9 & ESLint 6.8 - Version 3.10 ([DOWNLOAD](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rvest/vsextensions/vs-code-prettier-eslint/3.1.0/vspackage) | [README](https://github.com/idahogurl/vs-code-prettier-eslint/tree/3.x))
150-
- Prettier 2.0 & ESLint 7.0 - Version 4.10 ([DOWNLOAD](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rvest/vsextensions/vs-code-prettier-eslint/4.1.0/vspackage) |
148+
- Prettier 1.9 & ESLint 6.8 - Version 3.10.0 ([DOWNLOAD](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rvest/vsextensions/vs-code-prettier-eslint/3.1.0/vspackage) | [README](https://github.com/idahogurl/vs-code-prettier-eslint/tree/3.x))
149+
- Prettier 2.0 & ESLint 7.0 - Version 4.10.0 ([DOWNLOAD](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rvest/vsextensions/vs-code-prettier-eslint/4.1.0/vspackage) |
151150
[README](https://github.com/idahogurl/vs-code-prettier-eslint/tree/4.x))
151+
- Prettier 2.0 & ESLint 8.0 - Version 5.1.0 ([DOWNLOAD](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/rvest/vsextensions/vs-code-prettier-eslint/5.1.0/vspackage) | [README](https://github.com/idahogurl/vs-code-prettier-eslint/blob/5.x/README.md))
152152

153153
## Contributing
154154

@@ -162,11 +162,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
162162
<!-- prettier-ignore-start -->
163163
<!-- markdownlint-disable -->
164164
<table>
165-
<tr>
166-
<td align="center"><a href="https://github.com/idahogurl"><img src="https://secure.gravatar.com/avatar/787139c4c697cfc33cc422566a4ccf78?s=80&d=identicon?s=100" width="100px;" alt=""/><br /><sub><b>Rebecca Vest</b></sub></a><br /><a href="#question-idahogurl" title="Answering Questions">💬</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Code">💻</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Documentation">📖</a> <a href="#infra-idahogurl" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/issues?q=author%3Aidahogurl" title="Bug reports">🐛</a> <a href="#ideas-idahogurl" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/pulls?q=is%3Apr+reviewed-by%3Aidahogurl" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Tests">⚠️</a></td>
167-
<td align="center"><a href="https://github.com/tbekaert"><img src="https://avatars.githubusercontent.com/u/11920484?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thomas Bekaert</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=tbekaert" title="Code">💻</a></td>
168-
<td align="center"><a href="https://mattbrannon.dev/"><img src="https://avatars.githubusercontent.com/u/36570183?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Brannon</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=mattbrannon" title="Documentation">📖</a></td>
169-
</tr>
165+
<tbody>
166+
<tr>
167+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/idahogurl"><img src="https://secure.gravatar.com/avatar/787139c4c697cfc33cc422566a4ccf78?s=80&d=identicon?s=100" width="100px;" alt="Rebecca Vest"/><br /><sub><b>Rebecca Vest</b></sub></a><br /><a href="#question-idahogurl" title="Answering Questions">💬</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Code">💻</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Documentation">📖</a> <a href="#infra-idahogurl" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/issues?q=author%3Aidahogurl" title="Bug reports">🐛</a> <a href="#ideas-idahogurl" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/pulls?q=is%3Apr+reviewed-by%3Aidahogurl" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=idahogurl" title="Tests">⚠️</a></td>
168+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tbekaert"><img src="https://avatars.githubusercontent.com/u/11920484?v=4?s=100" width="100px;" alt="Thomas Bekaert"/><br /><sub><b>Thomas Bekaert</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=tbekaert" title="Code">💻</a></td>
169+
<td align="center" valign="top" width="14.28%"><a href="https://mattbrannon.dev/"><img src="https://avatars.githubusercontent.com/u/36570183?v=4?s=100" width="100px;" alt="Matt Brannon"/><br /><sub><b>Matt Brannon</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=mattbrannon" title="Documentation">📖</a></td>
170+
<td align="center" valign="top" width="14.28%"><a href="https://www.1stg.me/"><img src="https://avatars.githubusercontent.com/u/8336744?v=4?s=100" width="100px;" alt="JounQin"/><br /><sub><b>JounQin</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=JounQin" title="Code">💻</a> <a href="https://github.com/idahogurl/vs-code-prettier-eslint/pulls?q=is%3Apr+reviewed-by%3AJounQin" title="Reviewed Pull Requests">👀</a></td>
171+
<td align="center" valign="top" width="14.28%"><a href="https://netux.site/"><img src="https://avatars.githubusercontent.com/u/6181929?v=4?s=100" width="100px;" alt="Martín Rodríguez"/><br /><sub><b>Martín Rodríguez</b></sub></a><br /><a href="https://github.com/idahogurl/vs-code-prettier-eslint/commits?author=netux" title="Code">💻</a></td>
172+
</tr>
173+
</tbody>
170174
</table>
171175

172176
<!-- markdownlint-restore -->

package.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616
"type": "git",
1717
"url": "https://github.com/idahogurl/vs-code-prettier-eslint"
1818
},
19-
"version": "5.1.1",
19+
"version": "6.0.0",
2020
"engines": {
2121
"vscode": "^1.63.0",
2222
"node": "^16.13.0"
2323
},
2424
"categories": [
2525
"Formatters"
2626
],
27+
"sponsor": {
28+
"url": "https://github.com/sponsors/idahogurl"
29+
},
2730
"main": "./dist/extension.js",
2831
"activationEvents": [
2932
"onLanguage:css",
@@ -41,17 +44,20 @@
4144
"onLanguage:typescript",
4245
"onLanguage:typescriptreact",
4346
"onLanguage:vue",
44-
"onLanguage:yaml"
47+
"onLanguage:yaml",
48+
"onStartupFinished"
4549
],
4650
"scripts": {
4751
"lint": "eslint . --ignore-pattern test/fixtures/",
4852
"pretest": "yarn lint",
4953
"test": "node ./test/runTest.js",
5054
"test:update": "SNAPSHOT_UPDATE=true node ./test/runTest.js",
51-
"dev": "NODE_ENV=dev node ./scripts/build.js",
52-
"watch": "NODE_ENV=dev,watch node ./scripts/build.js",
53-
"build": "NODE_ENV=prod node ./scripts/build.js",
54-
"package": "yarn build && vsce package --yarn",
55+
"build:dev": "yarn build:extension && yarn build:worker",
56+
"build": "yarn build:extension --minify && yarn build:worker --minify",
57+
"build:extension": "esbuild ./src/extension.js --bundle --sourcemap --platform=node --target=node16 --external:vscode --external:./worker.mjs --outfile=./dist/extension.js",
58+
"build:worker": "esbuild ./src/worker.mjs --bundle --sourcemap --platform=node --format=esm --target=node16 --outfile=./dist/worker.mjs",
59+
"package:dev": "yarn build:dev && vsce package",
60+
"package": "yarn build && vsce package",
5561
"contributors:add": "all-contributors add",
5662
"contributors:generate": "all-contributors generate"
5763
},
@@ -66,23 +72,24 @@
6672
"all-contributors-cli": "^6.24.0",
6773
"auto": "^10.42.2",
6874
"esbuild": "^0.16.14",
69-
"esbuild-plugin-text-replace": "^1.2.0",
70-
"eslint": "^8.31.0",
75+
"eslint": "^8.52.0",
7176
"eslint-config-airbnb-base": "^15.0.0",
7277
"eslint-plugin-import": "^2.26.0",
7378
"eslint-plugin-jest": "^27.2.0",
7479
"jest": "^29.3.1",
7580
"jest-environment-node": "^29.3.1",
7681
"ovsx": "^0.7.1",
77-
"prettier": "^2.8.1",
82+
"prettier": "^3.1.0",
83+
"prettier-eslint": "^16.1.2",
7884
"ts-node": "^10.9.1",
7985
"typescript": "^4.9.5",
8086
"vsce": "^2.15.0"
8187
},
8288
"dependencies": {
8389
"find-up": "^6.3.0",
8490
"ignore": "^5.2.4",
85-
"prettier-eslint": "^15.0.1"
91+
"require-relative": "^0.8.7",
92+
"synckit": "^0.9.0"
8693
},
8794
"contributes": {
8895
"configuration": {
@@ -96,6 +103,10 @@
96103
}
97104
}
98105
},
106+
"vsce": {
107+
"dependencies": false,
108+
"yarn": true
109+
},
99110
"__metadata": {
100111
"id": "d4b06bd6-36a0-469f-be55-c0a73413b688",
101112
"publisherDisplayName": "Rebecca Vest",
File renamed without changes.
File renamed without changes.

scripts/build.js

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

0 commit comments

Comments
 (0)