Skip to content

Commit

Permalink
fix: use synckit to support Prettier 3 (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
idahogurl authored Feb 6, 2024
1 parent 5c6b2e6 commit 41fe336
Show file tree
Hide file tree
Showing 15 changed files with 1,510 additions and 1,953 deletions.
19 changes: 19 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@
"contributions": [
"doc"
]
},
{
"login": "JounQin",
"name": "JounQin",
"avatar_url": "https://avatars.githubusercontent.com/u/8336744?v=4",
"profile": "https://www.1stg.me/",
"contributions": [
"code",
"review"
]
},
{
"login": "netux",
"name": "Martín Rodríguez",
"avatar_url": "https://avatars.githubusercontent.com/u/6181929?v=4",
"profile": "https://netux.site/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Test

on:
push:
branches: ['master']
branches: ["master"]
pull_request:
branches: ['master']
branches: ["master"]

jobs:
build:
strategy:
matrix:
# os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
os: ['ubuntu-latest']
os: ["ubuntu-latest"]

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

Expand All @@ -20,7 +20,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn build
- run: xvfb-run -a yarn test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist/
test/fixtures/temp
coverage/
.env
/*.vsix
16 changes: 0 additions & 16 deletions .gitlab-ci.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v6.0.0 (Fri Dec 1 2023)

#### 🚀 Enhancement

- fix: use `worker_threads` via [`synckit`](https://github.com/un-ts/synckit) to support Prettier 3

#### ⚠️ Breaking Changes
- `prettier-eslint` is no longer bundled with the extension and must be installed by the user
- Prettier v3.0 is now required
- ESLint >= v8.52.0 is now required

# v5.1.0 (Fri Mar 10 2023)

:tada: This release contains work from a new contributor! :tada:
Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<img src="https://github.com/idahogurl/vs-code-prettier-eslint/blob/master/icon.png?raw=true" width="150">

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)

[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

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

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

- `prettier@^2.5.1`
- `eslint@^8.7.0`
- `prettier@^3.1.0`
- `eslint@^8.52.0`
- `prettier-eslint@^16.1.2`
- `@typescript-eslint/parser@^5.0.1` and `typescript@^4.4.4` **(Only for TypeScript projects)**
- `vue-eslint-parser@^8.0.0` **(Only for Vue projects)**

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

### Install Dependencies

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`
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`

#### Minimum Requirements

```bash
yarn add -D prettier@^2.5.1 eslint@^8.7.0
yarn add -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2
```

#### TypeScript Projects

```bash
yarn add -D prettier@^2.5.1 eslint@^8.7.0 @typescript-eslint/parser@^5.0.1 typescript@^4.4.4
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
```

#### Vue Projects

```bash
yarn add -D prettier@^2.5.1 eslint@^8.7.0 vue-eslint-parser@^8.0.0
yarn add -D prettier@^3.1.0 eslint@^8.52.0 prettier-eslint@^16.1.2 vue-eslint-parser@^8.0.0
```

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

## Support for Earlier Versions

- 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))
- 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) |
- 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))
- 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) |
[README](https://github.com/idahogurl/vs-code-prettier-eslint/tree/4.x))
- 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))

## Contributing

Expand All @@ -162,11 +162,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<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>
<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>
<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>
</tr>
<tbody>
<tr>
<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>
<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>
<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>
<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>
<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>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down
31 changes: 21 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
"type": "git",
"url": "https://github.com/idahogurl/vs-code-prettier-eslint"
},
"version": "5.1.1",
"version": "6.0.0",
"engines": {
"vscode": "^1.63.0",
"node": "^16.13.0"
},
"categories": [
"Formatters"
],
"sponsor": {
"url": "https://github.com/sponsors/idahogurl"
},
"main": "./dist/extension.js",
"activationEvents": [
"onLanguage:css",
Expand All @@ -41,17 +44,20 @@
"onLanguage:typescript",
"onLanguage:typescriptreact",
"onLanguage:vue",
"onLanguage:yaml"
"onLanguage:yaml",
"onStartupFinished"
],
"scripts": {
"lint": "eslint . --ignore-pattern test/fixtures/",
"pretest": "yarn lint",
"test": "node ./test/runTest.js",
"test:update": "SNAPSHOT_UPDATE=true node ./test/runTest.js",
"dev": "NODE_ENV=dev node ./scripts/build.js",
"watch": "NODE_ENV=dev,watch node ./scripts/build.js",
"build": "NODE_ENV=prod node ./scripts/build.js",
"package": "yarn build && vsce package --yarn",
"build:dev": "yarn build:extension && yarn build:worker",
"build": "yarn build:extension --minify && yarn build:worker --minify",
"build:extension": "esbuild ./src/extension.js --bundle --sourcemap --platform=node --target=node16 --external:vscode --external:./worker.mjs --outfile=./dist/extension.js",
"build:worker": "esbuild ./src/worker.mjs --bundle --sourcemap --platform=node --format=esm --target=node16 --outfile=./dist/worker.mjs",
"package:dev": "yarn build:dev && vsce package",
"package": "yarn build && vsce package",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
},
Expand All @@ -66,23 +72,24 @@
"all-contributors-cli": "^6.24.0",
"auto": "^10.42.2",
"esbuild": "^0.16.14",
"esbuild-plugin-text-replace": "^1.2.0",
"eslint": "^8.31.0",
"eslint": "^8.52.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.0",
"jest": "^29.3.1",
"jest-environment-node": "^29.3.1",
"ovsx": "^0.7.1",
"prettier": "^2.8.1",
"prettier": "^3.1.0",
"prettier-eslint": "^16.1.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"vsce": "^2.15.0"
},
"dependencies": {
"find-up": "^6.3.0",
"ignore": "^5.2.4",
"prettier-eslint": "^15.0.1"
"require-relative": "^0.8.7",
"synckit": "^0.9.0"
},
"contributes": {
"configuration": {
Expand All @@ -96,6 +103,10 @@
}
}
},
"vsce": {
"dependencies": false,
"yarn": true
},
"__metadata": {
"id": "d4b06bd6-36a0-469f-be55-c0a73413b688",
"publisherDisplayName": "Rebecca Vest",
Expand Down
File renamed without changes
File renamed without changes
38 changes: 0 additions & 38 deletions scripts/build.js

This file was deleted.

Loading

0 comments on commit 41fe336

Please sign in to comment.