Skip to content

Commit

Permalink
Merge pull request #1178 from posit-dev/dotnomad/vscode-prettier
Browse files Browse the repository at this point in the history
Format VSCode extension code with Prettier
  • Loading branch information
sagerb authored Mar 21, 2024
2 parents c8bc040 + c445189 commit b1848ee
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/vscode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
key: ${{ matrix.runner }}-vscode-${{ env.VSCODE_VERSION }}-${{ steps.get-date.outputs.date }}
- run: just vscode configure
- run: just vscode lint
- run: just vscode check-format
- run: just vscode test
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -53,6 +54,7 @@ jobs:
key: docker-vscode-${{ env.VSCODE_VERSION }}-${{ steps.get-date.outputs.date }}
- run: just vscode configure
- run: just vscode lint
- run: just vscode check-format
- run: just vscode test
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
5 changes: 4 additions & 1 deletion extensions/vscode/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"plugins": [
"@typescript-eslint"
],
"extends": [
"prettier"
],
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/semi": "warn",
Expand All @@ -22,4 +25,4 @@
"**/*.d.ts",
"api"
]
}
}
1 change: 1 addition & 0 deletions extensions/vscode/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
14 changes: 14 additions & 0 deletions extensions/vscode/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ lint:
npm run lint

format:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
npm run format

check-format:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
npm run check-format

# Packages the extension.
package os="$(just ../../os)" arch="$(just ../../arch)":
#!/usr/bin/env bash
Expand Down
29 changes: 29 additions & 0 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"when": "viewItem == posit.publisher.deployments.tree.item.deployment",
"group": "inline"
},
{
{
"command": "posit.publisher.files.addExclusion",
"when": "viewItem == posit.publisher.files.isIncludedFile",
"group": "inline"
Expand Down Expand Up @@ -444,6 +444,8 @@
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"lint": "eslint src --ext ts",
"format": "prettier . --write",
"check-format": "prettier . --check",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
Expand All @@ -458,8 +460,10 @@
"@typescript-eslint/parser": "^6.7.3",
"@vscode/test-electron": "^2.3.8",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.1.0",
"glob": "^10.3.3",
"mocha": "^10.2.0",
"prettier": "3.2.5",
"typescript": "^5.2.2"
},
"dependencies": {
Expand All @@ -469,4 +473,4 @@
"mutexify": "^1.4.0",
"retry": "^0.13.1"
}
}
}

0 comments on commit b1848ee

Please sign in to comment.