Skip to content

Commit 2e7557b

Browse files
committed
Run type checking on all directories in CI
This commit adds a new step to the CI workflow that runs type checking on all directories containing `tsconfig.json` files, using `find` and `xargs`. Unfortunately, this does not work on Windows, so on Windows it's not possible to run all of these type checks locally.
1 parent 572ba29 commit 2e7557b

35 files changed

+61
-51
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ jobs:
9090
npm ci
9191
shell: bash
9292

93+
- name: Check types
94+
working-directory: extensions/ql-vscode
95+
run: |
96+
npm run check-types
97+
9398
- name: Lint
9499
working-directory: extensions/ql-vscode
95100
run: |

extensions/ql-vscode/gulpfile.ts/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"noImplicitReturns": true,
1717
"experimentalDecorators": true,
1818
"noUnusedLocals": true,
19-
"noUnusedParameters": true,
20-
"esModuleInterop": true
19+
"noUnusedParameters": true
2120
},
2221
"include": ["*.ts"]
2322
}

extensions/ql-vscode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@
12991299
"storybook": "start-storybook -p 6006",
13001300
"build-storybook": "build-storybook",
13011301
"lint:scenarios": "ts-node scripts/lint-scenarios.ts",
1302+
"check-types": "find . -type f -name \"tsconfig.json\" -not -path \"./node_modules/*\" | sed -r 's|/[^/]+$||' | sort | uniq | xargs -I {} sh -c \"echo Checking types in {} && cd {} && npx tsc --noEmit\"",
13021303
"postinstall": "patch-package"
13031304
},
13041305
"dependencies": {
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
module.exports = {
22
env: {
3-
browser: true
3+
browser: true,
44
},
5-
plugins: [
6-
"github",
7-
],
5+
plugins: ["github"],
86
extends: [
97
"plugin:github/react",
108
"plugin:github/recommended",
@@ -16,12 +14,13 @@ module.exports = {
1614
rules: {
1715
"filenames/match-regex": "off",
1816
"import/named": "off",
17+
"import/no-namespace": "off",
1918
"import/no-unresolved": "off",
2019
"no-unused-vars": "off",
2120
},
2221
settings: {
2322
react: {
24-
version: 'detect'
25-
}
26-
}
27-
}
23+
version: "detect",
24+
},
25+
},
26+
};

extensions/ql-vscode/src/stories/common/Alert.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react";

extensions/ql-vscode/src/stories/common/CodePaths.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44
import { ThemeProvider } from "@primer/react";

extensions/ql-vscode/src/stories/common/FileCodeSnippet.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44

extensions/ql-vscode/src/stories/common/LastUpdated.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44

extensions/ql-vscode/src/stories/common/StarCount.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44

extensions/ql-vscode/src/stories/common/icon/Codicon.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from "react";
1+
import * as React from "react";
22

33
import { ComponentStory, ComponentMeta } from "@storybook/react";
44

55
import { CodePaths, Codicon as CodiconComponent } from "../../../view/common";
66

77
// To regenerate the icons, use the following command from the `extensions/ql-vscode` directory:
88
// jq -R '[inputs | [splits(", *")] as $row | $row[0]]' < node_modules/@vscode/codicons/dist/codicon.csv > src/stories/common/icon/vscode-icons.json
9-
import icons from "./vscode-icons.json";
9+
import * as icons from "./vscode-icons.json";
1010

1111
export default {
1212
title: "Icon/Codicon",

0 commit comments

Comments
 (0)