Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js/web] fix typescript type check #18343

Merged
merged 4 commits into from
Nov 11, 2023
Merged

[js/web] fix typescript type check #18343

merged 4 commits into from
Nov 11, 2023

Conversation

fs-eire
Copy link
Contributor

@fs-eire fs-eire commented Nov 8, 2023

Description

This PR fixes the TypeScript type check.

Previously, when I use esbuild to replace webpack (#17745), typescript typecheck was disabled. This causes a few TypeScript type error checked in into the code base. This PR fixes the followings:

  • Use "Node16" as default "module" value in tsconfig.json, because in TypeScript v5, (module == "ES2015" && moduleResolution == "Node16") is an invalid combination.
  • Set noUnusedParameters to true as default. in web override it to false because multiple code need to be updated ( a following-up PR will do this )
  • set correct project file for 'web/lib/**/*.ts' for ESLint (otherwise WebGPU types are not populated correctly)
  • fix type error in file js/web/lib/wasm/jsep/webgpu/program-manager.ts
  • upgrade "@webgpu/types" to latest to fix type error in file js/web/lib/wasm/jsep/backend-webgpu.ts
  • add package script "prebuild" for web to run tsc type check
  • add type check in CI yml file

@fs-eire fs-eire requested a review from a team as a code owner November 8, 2023 02:10
snnn
snnn previously approved these changes Nov 8, 2023
@fs-eire fs-eire merged commit 6b0c97b into main Nov 11, 2023
91 checks passed
@fs-eire fs-eire deleted the fs-eire/fix-ts-build-break branch November 11, 2023 00:03
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
### Description

This PR fixes the TypeScript type check.

Previously, when I use esbuild to replace webpack (microsoft#17745), typescript
typecheck was disabled. This causes a few TypeScript type error checked
in into the code base. This PR fixes the followings:

- Use "Node16" as default "module" value in tsconfig.json, because in
TypeScript v5, `(module == "ES2015" && moduleResolution == "Node16")` is
an invalid combination.
- Set `noUnusedParameters` to true as default. in web override it to
false because multiple code need to be updated ( a following-up PR will
do this )
- set correct project file for 'web/lib/**/*.ts' for ESLint (otherwise
WebGPU types are not populated correctly)
- fix type error in file js/web/lib/wasm/jsep/webgpu/program-manager.ts
- upgrade "@webgpu/types" to latest to fix type error in file
js/web/lib/wasm/jsep/backend-webgpu.ts
- add package script "prebuild" for web to run tsc type check
- add type check in CI yml file
siweic0 pushed a commit to siweic0/onnxruntime-web that referenced this pull request May 9, 2024
### Description

This PR fixes the TypeScript type check.

Previously, when I use esbuild to replace webpack (microsoft#17745), typescript
typecheck was disabled. This causes a few TypeScript type error checked
in into the code base. This PR fixes the followings:

- Use "Node16" as default "module" value in tsconfig.json, because in
TypeScript v5, `(module == "ES2015" && moduleResolution == "Node16")` is
an invalid combination.
- Set `noUnusedParameters` to true as default. in web override it to
false because multiple code need to be updated ( a following-up PR will
do this )
- set correct project file for 'web/lib/**/*.ts' for ESLint (otherwise
WebGPU types are not populated correctly)
- fix type error in file js/web/lib/wasm/jsep/webgpu/program-manager.ts
- upgrade "@webgpu/types" to latest to fix type error in file
js/web/lib/wasm/jsep/backend-webgpu.ts
- add package script "prebuild" for web to run tsc type check
- add type check in CI yml file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants