Skip to content

Commit 00e903f

Browse files
authored
Merge pull request #152 from distributed-lab/vscode/refactor
refactor: vscode extension - also testing whether the extension's build-deploy script works.
2 parents 70b290e + 11740be commit 00e903f

8 files changed

Lines changed: 773 additions & 1273 deletions

File tree

.github/workflows/typescript.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Continious integration for VSCode extension
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
eslint:
8+
name: 'Node.js v${{ matrix.node }}'
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node:
13+
- 22
14+
15+
steps:
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: '${{ matrix.node }}'
19+
20+
- uses: actions/checkout@v4
21+
22+
- name: 'Cache node_modules'
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.npm
26+
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('**/package.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-node-v${{ matrix.node }}-
29+
30+
- name: 'Install Dependencies'
31+
run: npm ci
32+
working-directory: ./vscode
33+
34+
- name: 'Run ESLint'
35+
run: npm run eslint-check
36+
working-directory: ./vscode

vscode/esbuild.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
const esbuild = require("esbuild");
1+
import { context } from "esbuild";
2+
import process from "node:process";
23

34
const production = process.argv.includes("--production");
45
const watch = process.argv.includes("--watch");
56

67
async function main() {
7-
const ctx = await esbuild.context({
8+
const ctx = await context({
89
entryPoints: ["src/extension.ts"],
910
bundle: true,
1011
format: "cjs",
@@ -16,7 +17,6 @@ async function main() {
1617
external: ["vscode"],
1718
logLevel: "warning",
1819
plugins: [
19-
/* add to the end of plugins array */
2020
esbuildProblemMatcherPlugin,
2121
],
2222
});

vscode/eslint.config.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import js from "@eslint/js";
2+
3+
import { defineConfig } from "eslint/config";
4+
import globals from "globals";
5+
import tseslint from "typescript-eslint";
6+
7+
export default defineConfig(
8+
{
9+
ignores: ["dist/**", "node_modules/**", "generated-types/**", "artifacts/**", "coverage/**"],
10+
},
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
{
14+
files: ["src/**/*.ts"],
15+
languageOptions: {
16+
parser: tseslint.parser,
17+
parserOptions: {
18+
project: "./tsconfig.json",
19+
tsconfigRootDir: process.cwd(),
20+
},
21+
globals: {
22+
...globals.node,
23+
},
24+
},
25+
plugins: {
26+
"@typescript-eslint": tseslint.plugin,
27+
},
28+
rules: {
29+
"@typescript-eslint/ban-ts-comment": "off",
30+
"@typescript-eslint/no-explicit-any": "off",
31+
"@typescript-eslint/no-unused-expressions": "off",
32+
"@typescript-eslint/no-floating-promises": "error",
33+
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: { attributes: false } }],
34+
},
35+
},
36+
{
37+
files: ["**/*.js"],
38+
languageOptions: {
39+
globals: {
40+
...globals.node,
41+
},
42+
},
43+
}
44+
);

0 commit comments

Comments
 (0)