Skip to content

Commit f21d090

Browse files
author
Alex Remedios
authored
tsc pre-commit (#7)
1 parent 32dcf03 commit f21d090

5 files changed

Lines changed: 20 additions & 10 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
python-version: ${{ matrix.cfg.python-version }}
4242
- run: pip install poetry
4343
- run: poetry config virtualenvs.in-project true
44-
- run: poetry -V
44+
- run: yarn install
4545
- run: poetry install
4646
- uses: pre-commit/action@v2.0.0
4747
with:

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ repos:
3232
hooks:
3333
- id: isort
3434
args: [-m, '3', --tc]
35+
- repo: https://github.com/pre-commit/mirrors-prettier
36+
rev: v2.2.1
37+
hooks:
38+
- id: prettier
39+
types:
40+
- ts
3541
- repo: local
3642
hooks:
3743
- id: pyright
@@ -41,3 +47,12 @@ repos:
4147
pass_filenames: false
4248
types: [python]
4349
additional_dependencies: [pyright@1.1.91]
50+
- repo: local
51+
hooks:
52+
- id: tsc-lint
53+
name: tsc-lint
54+
entry: bash -c 'yarn compile && yarn lint --fix'
55+
language: node
56+
pass_filenames: false
57+
types:
58+
- ts

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
},
7474
"scripts": {
7575
"compile": "tsc -p ./",
76-
"format": "prettier --write src/**/*.ts",
77-
"format-check": "prettier --check src/**/*.ts",
7876
"lint": "eslint src --ext ts",
7977
"pretest": "yarn run compile && yarn run lint",
8078
"test": "node ./out/test/runTest.js",

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CliRunner {
2828
console.log(shellCmd)
2929
try {
3030
return await exec(shellCmd)
31-
} catch (ee: any) {
31+
} catch (ee) {
3232
console.log(ee)
3333
console.log(ee.sdterr)
3434
throw ee
@@ -56,7 +56,7 @@ export async function activate(
5656
async () => {
5757
try {
5858
await exec(`which ${cli}`)
59-
} catch (e: any) {
59+
} catch (e) {
6060
vscode.window.showErrorMessage(
6161
`Cannot find deeptest cli at "${cli}", please check the deeptest vscode settings.`
6262
)
@@ -190,7 +190,7 @@ export async function activate(
190190
decs.push(decoration)
191191
}
192192
return decs
193-
} catch (ee: any) {
193+
} catch (ee) {
194194
console.log('ERROR')
195195
if (ee.stderr) {
196196
console.log(ee.stderr)

src/test/suite/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ export async function run(): Promise<void> {
1515
glob('**/**.test.js', {cwd: testsRoot}, (err, files) => {
1616
if (err) {
1717
return e(err)
18-
}
19-
20-
// Add files to the test suite
18+
} // Add files to the test suite
2119
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)))
22-
2320
try {
2421
// Run the mocha test
2522
mocha.run(failures => {

0 commit comments

Comments
 (0)