Skip to content

Commit

Permalink
Merge pull request #3597 from continuedev/dallin/gui-strict-null-checks
Browse files Browse the repository at this point in the history
GUI strict null checks
  • Loading branch information
sestinj authored Jan 7, 2025
2 parents bcc638f + 0a3fb19 commit a0d0bda
Show file tree
Hide file tree
Showing 52 changed files with 426 additions and 647 deletions.
1 change: 0 additions & 1 deletion core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ export class Core {

const chunk = next.value;

// @ts-ignore
yield { content: chunk };
next = await gen.next();
}
Expand Down
20 changes: 18 additions & 2 deletions core/protocol/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,26 @@ import type {
} from "../";
import { ConfigResult } from "../config/load";

export type ProtocolGeneratorType<T> = AsyncGenerator<{
export type ProtocolGeneratorYield<T> = {
done?: boolean;
content: T;
}>;
};
export type ProtocolGeneratorType<Y> = AsyncGenerator<
ProtocolGeneratorYield<Y>
>;

export type AsyncGeneratorYieldType<T> =
T extends AsyncGenerator<infer Y, any, any>
? Y extends ProtocolGeneratorYield<infer PR>
? PR
: never
: never;
// export type AsyncGeneratorReturnType<T> =
// T extends AsyncGenerator<any, infer R, any>
// ? R extends ProtocolGeneratorYield<infer PR>
// ? PR
// : never
// : never;

export type OnboardingModes =
| "Local"
Expand Down
2 changes: 1 addition & 1 deletion core/protocol/ideWebview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type ToIdeFromWebviewProtocol = ToIdeFromWebviewOrCoreProtocol & {
vscMediaUrl: string;
},
];
"jetbrains/getColors": [undefined, void];
"jetbrains/getColors": [undefined, Record<string, string>];
"vscode/openMoveRightMarkdown": [undefined, void];
setGitHubAuthToken: [{ token: string }, void];
acceptDiff: [{ filepath: string; streamId?: string }, void];
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 8 additions & 15 deletions gui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"strict-null-checks",
"eslint-plugin-react"
],
"plugins": ["@typescript-eslint", "eslint-plugin-react"],
"parserOptions": {
"project": "gui/tsconfig.strictNullChecks.json"
},
// "extends": [
// "eslint:recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
// "plugin:react/recommended"
// ],
"rules": {
"strict-null-checks/all": "warn"
"project": "gui/tsconfig.json"
},
"extends": [
// "eslint:recommended",
// "plugin:@typescript-eslint/recommended",
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
// "plugin:react/recommended"
],
"overrides": [
{
"files": ["src/**/*.{js,ts,jsx,tsx}"]
Expand Down
Loading

0 comments on commit a0d0bda

Please sign in to comment.