Fix ESLint errors in `cvat-data.ts` (#5247)

By converting it into an ES6 module.  Also, fix `tsconfig.json` so that
ESLint knows that the file is actually in the project.
main
Roman Donchenko 3 years ago committed by GitHub
parent 12961b35d6
commit 0a5b71123d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,23 +2,23 @@
// //
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
const { Mutex } = require('async-mutex'); import { Mutex } from 'async-mutex';
// eslint-disable-next-line max-classes-per-file // eslint-disable-next-line max-classes-per-file
const { MP4Reader, Bytestream } = require('./3rdparty/mp4'); import { MP4Reader, Bytestream } from './3rdparty/mp4';
const ZipDecoder = require('./unzip_imgs.worker'); import ZipDecoder from './unzip_imgs.worker';
const H264Decoder = require('./3rdparty/Decoder.worker'); import H264Decoder from './3rdparty/Decoder.worker';
const BlockType = Object.freeze({ export const BlockType = Object.freeze({
MP4VIDEO: 'mp4video', MP4VIDEO: 'mp4video',
ARCHIVE: 'archive', ARCHIVE: 'archive',
}); });
const DimensionType = Object.freeze({ export const DimensionType = Object.freeze({
DIM_3D: '3d', DIM_3D: '3d',
DIM_2D: '2d', DIM_2D: '2d',
}); });
class FrameProvider { export class FrameProvider {
constructor( constructor(
blockType, blockType,
blockSize, blockSize,
@ -373,9 +373,3 @@ class FrameProvider {
return [...this._blocksRanges].sort((a, b) => a.split(':')[0] - b.split(':')[0]); return [...this._blocksRanges].sort((a, b) => a.split(':')[0] - b.split(':')[0]);
} }
} }
module.exports = {
FrameProvider,
BlockType,
DimensionType,
};

@ -9,5 +9,5 @@
"noEmit": true, "noEmit": true,
"baseUrl": "src", "baseUrl": "src",
}, },
"include": ["src/*.ts"] "include": ["src/ts/*.ts"]
} }

Loading…
Cancel
Save