Skip to content

Commit fe08161

Browse files
authored
Add linting check and fix linting issues (#30)
1 parent 56e7654 commit fe08161

37 files changed

+778
-939
lines changed

.github/workflows/pr-check.yml

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
- release*
99

1010
env:
11-
NODE_VERSION: 18.17.1
12-
11+
NODE_VERSION: '20.18.0'
1312

1413
jobs:
1514
build-vsix:
@@ -24,3 +23,53 @@ jobs:
2423
uses: ./.github/actions/build-vsix
2524
with:
2625
node_version: ${{ env.NODE_VERSION }}
26+
27+
lint:
28+
name: Lint
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Install Node
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: ${{ env.NODE_VERSION }}
39+
cache: 'npm'
40+
41+
- name: Install Dependencies
42+
run: npm ci
43+
44+
- name: Run Linter
45+
run: npm run lint
46+
47+
ts-unit-tests:
48+
name: TypeScript Unit Tests
49+
runs-on: ${{ matrix.os }}
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
os: [ubuntu-latest, windows-latest]
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Install Node
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: ${{ env.NODE_VERSION }}
63+
cache: 'npm'
64+
65+
- name: Install Dependencies
66+
run: npm ci
67+
68+
- name: Compile Tests
69+
run: npm run pretest
70+
71+
- name: Localization
72+
run: npx @vscode/l10n-dev@latest export ./src
73+
74+
- name: Run Tests
75+
run: npm run unittest

.github/workflows/push-check.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'release-*'
1010

1111
env:
12-
NODE_VERSION: 18.17.1
12+
NODE_VERSION: '20.18.0'
1313

1414
jobs:
1515
build-vsix:
@@ -23,4 +23,54 @@ jobs:
2323
- name: Build VSIX
2424
uses: ./.github/actions/build-vsix
2525
with:
26-
node_version: ${{ env.NODE_VERSION }}
26+
node_version: ${{ env.NODE_VERSION }}
27+
28+
lint:
29+
name: Lint
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Install Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: ${{ env.NODE_VERSION }}
40+
cache: 'npm'
41+
42+
- name: Install Dependencies
43+
run: npm ci
44+
45+
- name: Run Linter
46+
run: npm run lint
47+
48+
ts-unit-tests:
49+
name: TypeScript Unit Tests
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
os: [ubuntu-latest, windows-latest]
55+
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
60+
- name: Install Node
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: ${{ env.NODE_VERSION }}
64+
cache: 'npm'
65+
66+
- name: Install Dependencies
67+
run: npm ci
68+
69+
- name: Compile Tests
70+
run: npm run pretest
71+
72+
- name: Localization
73+
run: npx @vscode/l10n-dev@latest export ./src
74+
75+
- name: Run Tests
76+
run: npm run unittest

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{
1717
"args": [
1818
"-u=tdd",
19-
"--timeout=999999",
19+
"--timeout=180000",
2020
"--colors",
2121
"--recursive",
2222
//"--grep", "<suite name>",

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
"[typescript]": {
1515
"editor.defaultFormatter": "esbenp.prettier-vscode"
1616
},
17+
"[python]": {
18+
"editor.defaultFormatter": "charliermarsh.ruff",
19+
"diffEditor.ignoreTrimWhitespace": false
20+
},
1721
"prettier.tabWidth": 4
1822
}

build/.mocha.unittests.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"spec": "./out/test/**/*.unit.test.js",
3+
"require": ["out/test/unittests.js"],
4+
"ui": "tdd",
5+
"recursive": true,
6+
"colors": true,
7+
"timeout": 180000
8+
}

eslint.config.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,22 @@ export default [{
1919
selector: "import",
2020
format: ["camelCase", "PascalCase"],
2121
}],
22-
22+
"@typescript-eslint/no-unused-vars": [
23+
"error",
24+
{
25+
"args": "all",
26+
"argsIgnorePattern": "^_",
27+
"caughtErrors": "all",
28+
"caughtErrorsIgnorePattern": "^_",
29+
"destructuredArrayIgnorePattern": "^_",
30+
"varsIgnorePattern": "^_",
31+
"ignoreRestSiblings": true
32+
}
33+
],
2334
curly: "warn",
2435
eqeqeq: "warn",
2536
"no-throw-literal": "warn",
2637
semi: "warn",
38+
"@typescript-eslint/no-explicit-any": "warn",
2739
},
2840
}];

0 commit comments

Comments
 (0)