Skip to content

Commit e0ed9f7

Browse files
committed
tslint: Enable no-var-requires
Rationale from the rule's page: AMD-style require([]) and CommonJS-style require("") statements are environment-specific and more difficult to statically analyze. ES2015-style imports are part of the JavaScript language specfication and recommended as the path going forward. TypeScript will compile them to environment-specific forms as needed.
1 parent 57afc83 commit e0ed9f7

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/backend/mi2/mi2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as fs from "fs"
88
import { posix } from "path"
99
import * as nativePath from "path"
1010
const path = posix;
11-
const Client = require("ssh2").Client;
11+
import { Client } from "ssh2";
1212

1313
export function escape(str: string) {
1414
return str.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");

test/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// to report the results back to the caller. When the tests are finished, return
1111
// a possible error to the callback or null if none.
1212

13-
const testRunner = require('vscode/lib/testrunner');
13+
import * as testRunner from "vscode/lib/testrunner";
1414

1515
// You can directly control Mocha options by uncommenting the following lines
1616
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info

tslint.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"no-shadowed-variable": false,
2727
"no-trailing-whitespace": false,
2828
"no-unnecessary-initializer": false,
29-
"no-var-requires": false,
3029
"object-literal-shorthand": false,
3130
"object-literal-sort-keys": false,
3231
"one-line": false,

0 commit comments

Comments
 (0)