Skip to content

Commit 209edf8

Browse files
Merge pull request #2825 from github/robertbrignull/any/preview.ts
Avoid using "as any" in .storybook/preview.ts
2 parents 3d410c9 + 26c3016 commit 209edf8

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

extensions/ql-vscode/.storybook/preview.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ import { action } from "@storybook/addon-actions";
55
// Allow all stories/components to use Codicons
66
import "@vscode/codicons/dist/codicon.css";
77

8-
(window as any).acquireVsCodeApi = () => ({
8+
import type { VsCodeApi } from "../src/view/vscode-api";
9+
10+
declare global {
11+
interface Window {
12+
acquireVsCodeApi: () => VsCodeApi;
13+
}
14+
}
15+
16+
window.acquireVsCodeApi = () => ({
917
postMessage: action("post-vscode-message"),
1018
setState: action("set-vscode-state"),
1119
});

extensions/ql-vscode/scripts/find-deadcode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { exit } from "process";
66
function ignoreFile(file: string): boolean {
77
return (
88
containsPath("gulpfile.ts", file) ||
9+
containsPath(".storybook", file) ||
910
containsPath(join("src", "stories"), file) ||
1011
pathsEqual(
1112
join("test", "vscode-tests", "jest-runner-installed-extensions.ts"),

extensions/ql-vscode/src/view/vscode-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
VariantAnalysisState,
77
} from "../common/interface-types";
88

9-
interface VsCodeApi {
9+
export interface VsCodeApi {
1010
/**
1111
* Post message back to vscode extension.
1212
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["**/*.ts*"],
3+
"include": ["**/*.ts*", ".storybook/**/*.ts*"],
44
"exclude": ["node_modules"]
55
}

0 commit comments

Comments
 (0)