TS2686

error TS2686: ‘ko’ refers to a UMD global, but the current file is a module. Consider adding an import instead.

Bad Code ❌

1
const downloadProgress = ko.observable();

Fixed Code ✔️

1
2
3
import ko from 'knockout';

const downloadProgress = ko.observable();

TS2686: ‘sinon’ refers to a UMD global, but the current file is a module. Consider adding an import instead.

Bad Code ❌

1
2
import { SinonFakeServer } from 'sinon';
let server: SinonFakeServer;

Fixed Code ✔️

1
2
import * as sinon from 'sinon';
let server: sinon.SinonFakeServer;