mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
### 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
41 lines
1.5 KiB
YAML
41 lines
1.5 KiB
YAML
steps:
|
|
- script: |
|
|
npm ci
|
|
workingDirectory: '$(Build.SourcesDirectory)/js'
|
|
displayName: 'npm ci /js/'
|
|
- script: |
|
|
npm ci
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/common'
|
|
displayName: 'npm ci /js/common/'
|
|
- script: |
|
|
npm test
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/common'
|
|
displayName: 'run onnxruntime-common tests'
|
|
- script: |
|
|
npm ci
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
|
displayName: 'npm ci /js/web/'
|
|
- script: |
|
|
npm run prebuild
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
|
displayName: 'run TypeScript type check in /js/web/'
|
|
- script: |
|
|
npm run lint
|
|
workingDirectory: '$(Build.SourcesDirectory)/js'
|
|
displayName: 'run ESLint'
|
|
- script: |
|
|
npm run format
|
|
workingDirectory: '$(Build.SourcesDirectory)/js'
|
|
displayName: 'Clang-format'
|
|
- script: |
|
|
node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following source files are not formatted: (did you run \"npm run format\"?)\n'+a)"
|
|
workingDirectory: '$(Build.SourcesDirectory)/js'
|
|
displayName: 'Check unformatted files'
|
|
- script: |
|
|
npm run build:doc
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
|
displayName: 'Generating documents'
|
|
- script: |
|
|
node -e "a=require('child_process').execSync('git diff --name-only').toString();if(a)throw new Error('Following documents are not up-to-date: (did you run \"npm run build:doc\"?)\n'+a)"
|
|
workingDirectory: '$(Build.SourcesDirectory)/js/web'
|
|
displayName: 'Check out of dated documents'
|