Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(typescript): turn on esModuleInterop #2743

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

import * as crypto from 'crypto';
import crypto from 'crypto';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work? Reading MDN, this syntax means "import default", while we need "import everything as a namespace".

import { EventEmitter } from 'events';
import * as fs from 'fs';
import * as removeFolder from 'rimraf';
import * as util from 'util';
import fs from 'fs';
import removeFolder from 'rimraf';
import util from 'util';
import * as types from './types';
import { Progress } from './progress';

Expand Down
16 changes: 8 additions & 8 deletions src/install/browserFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
* limitations under the License.
*/

import * as extract from 'extract-zip';
import * as fs from 'fs';
import * as ProxyAgent from 'https-proxy-agent';
import * as os from 'os';
import * as path from 'path';
import * as ProgressBar from 'progress';
import extract from 'extract-zip';
import fs from 'fs';
import ProxyAgent from 'https-proxy-agent';
import os from 'os';
import path from 'path';
import ProgressBar from 'progress';
import { getProxyForUrl } from 'proxy-from-env';
import * as URL from 'url';
import * as util from 'util';
import URL from 'url';
import util from 'util';
import { assert, logPolitely, getFromENV } from '../helper';
import * as browserPaths from './browserPaths';
import { BrowserName, BrowserPlatform, BrowserDescriptor } from './browserPaths';
Expand Down
10 changes: 5 additions & 5 deletions src/install/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

import * as crypto from 'crypto';
import crypto from 'crypto';
import { getFromENV, logPolitely } from '../helper';
import * as fs from 'fs';
import * as path from 'path';
import * as util from 'util';
import * as removeFolder from 'rimraf';
import fs from 'fs';
import path from 'path';
import util from 'util';
import removeFolder from 'rimraf';
import * as browserPaths from '../install/browserPaths';
import * as browserFetcher from '../install/browserFetcher';

Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import * as debug from 'debug';
import debug from 'debug';
import { helper } from './helper';
import { LoggerSink, LoggerSeverity } from './loggerSink';

Expand Down
2 changes: 1 addition & 1 deletion src/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { helper } from './helper';
import { Progress } from './progress';

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"rootDir": "./src",
"outDir": "./lib",
"strict": true,
"declaration": false
"declaration": false,
"esModuleInterop": true
},
"compileOnSave": true,
"include": ["src/**/*.ts"],
Expand Down