Skip to content

Commit

Permalink
Fix ESLint errors in cvat-data.ts (cvat-ai#5247)
Browse files Browse the repository at this point in the history
By converting it into an ES6 module.  Also, fix `tsconfig.json` so that
ESLint knows that the file is actually in the project.
  • Loading branch information
SpecLad authored Nov 7, 2022
1 parent 12961b3 commit 0a5b711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
20 changes: 7 additions & 13 deletions cvat-data/src/ts/cvat-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
//
// SPDX-License-Identifier: MIT

const { Mutex } = require('async-mutex');
import { Mutex } from 'async-mutex';
// eslint-disable-next-line max-classes-per-file
const { MP4Reader, Bytestream } = require('./3rdparty/mp4');
const ZipDecoder = require('./unzip_imgs.worker');
const H264Decoder = require('./3rdparty/Decoder.worker');
import { MP4Reader, Bytestream } from './3rdparty/mp4';
import ZipDecoder from './unzip_imgs.worker';
import H264Decoder from './3rdparty/Decoder.worker';

const BlockType = Object.freeze({
export const BlockType = Object.freeze({
MP4VIDEO: 'mp4video',
ARCHIVE: 'archive',
});

const DimensionType = Object.freeze({
export const DimensionType = Object.freeze({
DIM_3D: '3d',
DIM_2D: '2d',
});

class FrameProvider {
export class FrameProvider {
constructor(
blockType,
blockSize,
Expand Down Expand Up @@ -373,9 +373,3 @@ class FrameProvider {
return [...this._blocksRanges].sort((a, b) => a.split(':')[0] - b.split(':')[0]);
}
}

module.exports = {
FrameProvider,
BlockType,
DimensionType,
};
2 changes: 1 addition & 1 deletion cvat-data/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"noEmit": true,
"baseUrl": "src",
},
"include": ["src/*.ts"]
"include": ["src/ts/*.ts"]
}

0 comments on commit 0a5b711

Please sign in to comment.