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.
This commit is contained in:
Simon Marchi 2018-07-18 10:52:35 -04:00
commit e0ed9f71b8
3 changed files with 2 additions and 3 deletions

View file

@ -8,7 +8,7 @@ import * as fs from "fs"
import { posix } from "path" import { posix } from "path"
import * as nativePath from "path" import * as nativePath from "path"
const path = posix; const path = posix;
const Client = require("ssh2").Client; import { Client } from "ssh2";
export function escape(str: string) { export function escape(str: string) {
return str.replace(/\\/g, "\\\\").replace(/"/g, "\\\""); return str.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");

View file

@ -10,7 +10,7 @@
// to report the results back to the caller. When the tests are finished, return // to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none. // a possible error to the callback or null if none.
const testRunner = require('vscode/lib/testrunner'); import * as testRunner from "vscode/lib/testrunner";
// You can directly control Mocha options by uncommenting the following lines // You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info

View file

@ -26,7 +26,6 @@
"no-shadowed-variable": false, "no-shadowed-variable": false,
"no-trailing-whitespace": false, "no-trailing-whitespace": false,
"no-unnecessary-initializer": false, "no-unnecessary-initializer": false,
"no-var-requires": false,
"object-literal-shorthand": false, "object-literal-shorthand": false,
"object-literal-sort-keys": false, "object-literal-sort-keys": false,
"one-line": false, "one-line": false,