Skip to content

Commit

Permalink
Add ESLint to openvinojs-wasm package
Browse files Browse the repository at this point in the history
  • Loading branch information
vishniakov-nikolai committed May 2, 2023
1 parent 4a9db9d commit 14c5fee
Show file tree
Hide file tree
Showing 8 changed files with 1,891 additions and 20 deletions.
5 changes: 5 additions & 0 deletions src/bindings/js/wasm/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: ['../.eslintrc.js'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
};
8 changes: 3 additions & 5 deletions src/bindings/js/wasm/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,14 @@ export function convertShape(

return {
obj: new ov.Shape(heapSpace, shape.dim),
free: () => ov._free(heapSpace)
free: () => ov._free(heapSpace),
};
}

export function parseOriginalTensor(
ov: OpenvinoWASMModule,
originalTensor: OriginalTensor
): Tensor {
console.log();

const precision = originalTensor.getPrecision();
const shape = parseOriginalShape(ov, originalTensor.getShape());

Expand Down Expand Up @@ -139,6 +137,6 @@ export function convertTensor(
free: () => {
originalShape.free();
ov._free(heapSpace);
}
};
},
};
}
8 changes: 6 additions & 2 deletions src/bindings/js/wasm/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ import { getVersionString, getDescriptionString } from './wasm-model';

import createModule from 'openvinojs-common';

export default
createModule('wasm', loadModel, getVersionString, getDescriptionString);
export default createModule(
'wasm',
loadModel,
getVersionString,
getDescriptionString
);
1 change: 0 additions & 1 deletion src/bindings/js/wasm/lib/maps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { JSArrayType } from 'openvinojs-common';
import { HEAPType } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/js/wasm/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TypedArray, PrecisionSupportedType } from 'openvinojs-common';

export type HEAPType =
export type HEAPType =
| 'HEAP8'
| 'HEAPU8'
| 'HEAP16'
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/js/wasm/lib/wasm-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
OpenvinoWASMModule,
OriginalModel,
OriginalTensor,
OriginalTensorWrapper
OriginalTensorWrapper,
} from './types';

const DEFAULT_PRECISION = 'u8';
Expand Down
Loading

0 comments on commit 14c5fee

Please sign in to comment.