Skip to content

Commit

Permalink
Switch formatter to dprint
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jan 13, 2023
1 parent cd6ec80 commit f17434a
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"extends": ["eslint:recommended", "prettier", "plugin:@typescript-eslint/recommended-requiring-type-checking"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking"],
"env": {
"browser": false
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:

- run: npx eslint .

prettier:
name: Prettier
dprint:
name: dprint
runs-on: ubuntu-latest

steps:
Expand All @@ -80,4 +80,4 @@ jobs:
node-version: 16
cache: "npm"

- run: npx prettier -c .
- run: npx dprint check
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

13 changes: 0 additions & 13 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["dbaeumer.vscode-eslint", "dprint.dprint"]
}
24 changes: 2 additions & 22 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript][javascript][json][jsonc][markdown][yaml]": {
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ GitHub action for [pyright](https://github.com/microsoft/pyright).
version: 1.1.244 # Optional
```
## Options
```yml
Expand Down Expand Up @@ -53,13 +52,12 @@ inputs:
default: 'false'
```
## Releasing `pyright-action`

Releases are performed by `release-it`, which correctly tags a new version and re-tags `v1`.
Unfortunately, you can only publish a GitHub action via the web UI (not via the API), so
`release-it` must be configured to open a browser to create the release, where the marketplace
checkbox will already be checked.
Releases are performed by `release-it`, which correctly tags a new version and
re-tags `v1`. Unfortunately, you can only publish a GitHub action via the web UI
(not via the API), so `release-it` must be configured to open a browser to
create the release, where the marketplace checkbox will already be checked.

```
$ npx release-it --ci # Release a patch version
Expand Down
33 changes: 33 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"indentWidth": 4,
"lineWidth": 120,
"newLineKind": "auto",
"useTabs": false,
"typescript": {
"quoteStyle": "preferDouble",
"semiColons": "always",
"arrowFunction.useParentheses": "force"
},
"json": {
},
"markdown": {
"textWrap": "always",
"lineWidth": 80
},
"prettier": {
"tabWidth": 2 // for yaml
},
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,yml}"],
"excludes": [
"**/node_modules",
"**/*-lock.json",
"dist/**",
"coverage/**"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.74.0.wasm",
"https://plugins.dprint.dev/json-0.15.6.wasm",
"https://plugins.dprint.dev/markdown-0.14.1.wasm",
"https://plugins.dprint.dev/prettier-0.12.0.json@f8c34316196cf4d0fb2f51b19073331258e15e71a934ee04a7b3328db684c98f"
]
}
Loading

0 comments on commit f17434a

Please sign in to comment.