mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
[js/web] fix lint error when run without ort-web TS types (#10429)
* [js/web] fix lint error when run without ort-web TS types * update CI to run linter before 'npm ci' in /js/web
This commit is contained in:
parent
1af4c170ef
commit
893ee65e54
3 changed files with 8 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ import {initializeWebAssembly} from '../wasm-factory';
|
|||
self.onmessage = (ev: MessageEvent<OrtWasmMessage>): void => {
|
||||
switch (ev.data.type) {
|
||||
case 'init-wasm':
|
||||
initializeWebAssembly(ev.data.in!)
|
||||
initializeWebAssembly(ev.data.in)
|
||||
.then(
|
||||
() => postMessage({type: 'init-wasm'} as OrtWasmMessage),
|
||||
err => postMessage({type: 'init-wasm', err} as OrtWasmMessage));
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ if (WASM) {
|
|||
}
|
||||
|
||||
fs.writeFileSync(WASM_BINDING_THREADED_MIN_JS_PATH, terser.stdout);
|
||||
fs.writeFileSync(WASM_THREADED_JS_PATH, COPYRIGHT_BANNER + terser.stdout);
|
||||
fs.writeFileSync(WASM_THREADED_JS_PATH, `${COPYRIGHT_BANNER}${terser.stdout}`);
|
||||
|
||||
validateFile(WASM_BINDING_THREADED_MIN_JS_PATH);
|
||||
validateFile(WASM_THREADED_JS_PATH);
|
||||
|
|
@ -124,7 +124,7 @@ if (WASM) {
|
|||
}
|
||||
|
||||
fs.writeFileSync(WASM_BINDING_THREADED_MIN_WORKER_JS_PATH, terser.stdout);
|
||||
fs.writeFileSync(WASM_THREADED_WORKER_JS_PATH, COPYRIGHT_BANNER + terser.stdout);
|
||||
fs.writeFileSync(WASM_THREADED_WORKER_JS_PATH, `${COPYRIGHT_BANNER}${terser.stdout}`);
|
||||
|
||||
validateFile(WASM_BINDING_THREADED_MIN_WORKER_JS_PATH);
|
||||
validateFile(WASM_THREADED_WORKER_JS_PATH);
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ jobs:
|
|||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js'
|
||||
displayName: 'npm ci /js/'
|
||||
- script: |
|
||||
npm run lint
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js'
|
||||
displayName: 'run ESLint without TS type populated'
|
||||
- script: |
|
||||
npm ci
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js\common'
|
||||
|
|
@ -83,7 +87,7 @@ jobs:
|
|||
- script: |
|
||||
npm run lint
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js'
|
||||
displayName: 'ESLint'
|
||||
displayName: 'run ESLint'
|
||||
- script: |
|
||||
npm run format
|
||||
workingDirectory: '$(Build.SourcesDirectory)\js'
|
||||
|
|
|
|||
Loading…
Reference in a new issue