Skip to content

Commit 55e0960

Browse files
committed
chore: ported to typescript
1 parent a2a6015 commit 55e0960

28 files changed

+384
-149
lines changed

.eslintrc

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2020,
6+
"sourceType": "module"
7+
},
28
"extends": [
9+
"plugin:@typescript-eslint/recommended",
10+
"prettier/@typescript-eslint",
311
"plugin:prettier/recommended"
412
],
5-
"env": {
6-
"es6": true,
7-
"node": true
8-
},
9-
"parserOptions": {
10-
"ecmaVersion": 8
13+
"rules": {
14+
"curly": "warn",
15+
"eqeqeq": "warn",
16+
"no-throw-literal": "warn",
17+
"semi": "off"
1118
},
1219
"overrides": [
1320
{
14-
"files": ["*.test.js"],
15-
"plugins": [
16-
"mocha"
17-
],
21+
"files": ["*.spec.ts"],
22+
"plugins": ["mocha"],
1823
"env": {
1924
"mocha": true
2025
},

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ npm-debug.log*
99
node_modules
1010
.vscode-test
1111
*.vsix
12+
13+
dist

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

.vscode/launch.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
15
{
2-
"version": "0.1.0",
6+
"version": "0.2.0",
37
"configurations": [
48
{
5-
"name": "Launch Extension",
9+
"name": "Run Extension",
610
"type": "extensionHost",
711
"request": "launch",
812
"runtimeExecutable": "${execPath}",
9-
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
10-
"stopOnEntry": false
13+
"args": [
14+
"--extensionDevelopmentPath=${workspaceFolder}"
15+
],
16+
"outFiles": [
17+
"${workspaceFolder}/out/**/*.js"
18+
],
19+
"preLaunchTask": "${defaultBuildTask}"
1120
},
1221
{
13-
"name": "Launch Tests",
22+
"name": "Extension Tests",
1423
"type": "extensionHost",
1524
"request": "launch",
1625
"runtimeExecutable": "${execPath}",
17-
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ],
18-
"stopOnEntry": false
26+
"args": [
27+
"--extensionDevelopmentPath=${workspaceFolder}",
28+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
29+
],
30+
"outFiles": [
31+
"${workspaceFolder}/out/test/**/*.js"
32+
],
33+
"preLaunchTask": "${defaultBuildTask}"
1934
}
2035
]
2136
}

.vscode/settings.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Place your settings in this file to overwrite default and user settings.
12
{
2-
"editor.tabSize": 2
3-
}
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off"
11+
}

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}

.vscodeignore

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
.vscode/**
2-
.vscode-test/**
3-
typings/**
4-
fixtures/**
5-
.gitignore
61
.eslintrc
2+
.gitignore
73
.prettierrc
4+
.vscode-test/**
5+
.vscode/**
86
*.log
9-
*.test.*
10-
jsconfig.json
7+
*.spec.*
8+
dist/**/*.map
9+
fixtures/**
10+
res/icon.xcf
11+
src/**
12+
tsconfig.json
13+
typings/**

lib/extension.js

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

lib/tfs/tfExe.js

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

package.json

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,18 @@
3333
},
3434
"homepage": "https://github.com/generalov/vscode-tfs#readme",
3535
"readmeFilename": "README.md",
36-
"main": "./lib/extension",
36+
"main": "./dist/extension",
3737
"engines": {
38-
"vscode": "^1.20.1"
38+
"vscode": "^1.45.1"
3939
},
4040
"scripts": {
41-
"test": "mocha \"lib/**/*.test.js\"",
42-
"lint": "eslint \"lib/**/*.js\"",
43-
"fix": "prettier --write \"lib/**/*.js\""
41+
"precompile": "yarn run rimraf dist",
42+
"vscode:prepublish": "yarn run compile",
43+
"compile": "tsc -p ./",
44+
"pretest": "yarn run compile && yarn run lint",
45+
"test": "mocha -r ts-node/register \"src/**/*.spec.ts\"",
46+
"lint": "eslint src --ext ts",
47+
"fix": "prettier --write \"src/**/*.ts\""
4448
},
4549
"activationEvents": [
4650
"onCommand:vscode-tfs.add",
@@ -124,11 +128,20 @@
124128
"child-process-promise": "^2.2.1"
125129
},
126130
"devDependencies": {
131+
"@types/child-process-promise": "^2.2.1",
132+
"@types/mocha": "^7.0.2",
133+
"@types/node": "^13.11.0",
134+
"@types/vscode": "^1.45.1",
135+
"@typescript-eslint/eslint-plugin": "^3.1.0",
136+
"@typescript-eslint/parser": "^3.1.0",
127137
"eslint": "7.2.0",
128-
"eslint-config-prettier": "6.11.0",
138+
"eslint-config-prettier": "^6.11.0",
129139
"eslint-plugin-mocha": "7.0.1",
130-
"eslint-plugin-prettier": "3.1.3",
140+
"eslint-plugin-prettier": "^3.1.3",
131141
"mocha": "^7.2.0",
132-
"prettier": "^2.0.5"
142+
"prettier": "^2.0.5",
143+
"rimraf": "^3.0.2",
144+
"ts-node": "^8.10.2",
145+
"typescript": "^3.9.5"
133146
}
134147
}

0 commit comments

Comments
 (0)