Skip to content

Commit

Permalink
Add vscode settings to match linter configurations (#74)
Browse files Browse the repository at this point in the history
Add vscode recommended extensions to match those in the dev container
Add development bundle command to generate source maps for debugging
Add vscode tasks to match package.json scripts
Update vscode launch configuration to rebuild the extension before debugging
  • Loading branch information
BTMorton committed Apr 24, 2023
1 parent a0b2fc0 commit 6d0c556
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"orta.vscode-jest",
"hbenl.vscode-test-explorer",
"dbaeumer.vscode-eslint"
]
}
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "Rebuild Test Explorer (Dev)",
"sourceMaps": true,
"resolveSourceMapLocations": [
"${workspaceFolder}/dist/**",
"${workspaceFolder}/out/**",
"!**/node_modules/**"
]
},
{
Expand Down
15 changes: 12 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true
}
},
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll": true
}
},
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.format.enable": true,

"editor.indentSize": 2,
"editor.insertSpaces": true,
"files.exclude": {
".git": true,
"node_modules": true
},

"jest.enableCodeLens": false
"jest.enableCodeLens": false,
"files.eol": "\n"
}
74 changes: 74 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": [
"$tsc"
],
"label": "Build Karma Test Explorer",
"detail": "tsc"
},
{
"type": "npm",
"script": "bundle",
"group": "build",
"problemMatcher": [
"$tsc"
],
"label": "Bundle Karma Test Explorer",
"detail": "bundle"
},
{
"type": "npm",
"script": "bundle-dev",
"group": "build",
"problemMatcher": [
"$tsc"
],
"label": "Bundle Karma Test Explorer (Dev)",
"detail": "bundle-dev"
},
{
"dependsOn": [
"Clean Build Output",
"Build Karma Test Explorer",
"Bundle Karma Test Explorer (Dev)"
],
"dependsOrder": "sequence",
"label": "Rebuild Test Explorer (Dev)",
"problemMatcher": []
},
{
"dependsOn": [
"Clean Build Output",
"Build Karma Test Explorer",
"Bundle Karma Test Explorer"
],
"dependsOrder": "sequence",
"label": "Rebuild Test Explorer",
"problemMatcher": []
},
{
"dependsOn": [
"Rebuild Test Explorer"
],
"label": "Package Extension",
"type": "npm",
"script": "package",
"detail": "package",
"problemMatcher": [],
"group": "build"
},
{
"label": "Clean Build Output",
"type": "npm",
"script": "clean",
"detail": "clean",
"problemMatcher": [],
"group": "build"
}
]
}
2 changes: 1 addition & 1 deletion esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
minifyIdentifiers: true,
minifyWhitespace: true,
minifySyntax: false,
sourcemap: false,
sourcemap: process.argv.includes('--dev'),
keepNames: true,
tsconfig: './tsconfig.json'
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"watch": "tsc -w",
"test": "jest -c jest.config.js",
"bundle": "node ./scripts/bundle.js",
"bundle-dev": "node ./scripts/bundle.js --dev",
"package": "npx vsce package --githubBranch master",
"publish": "npx vsce publish --githubBranch master",
"validate": "npm run format:check && npm run lint:check && npm run rebuild && npm run test && npm run bundle && npm run package"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"noUnusedLocals": true,
"removeComments": true,
"skipLibCheck": true,
"allowJs": true
"allowJs": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 6d0c556

Please sign in to comment.