Skip to content

Commit

Permalink
Only require tslint once. Fixes angelozerr#65
Browse files Browse the repository at this point in the history
  • Loading branch information
clusterseven\agurden committed Apr 16, 2018
1 parent d692ead commit 2ba928f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Expand Up @@ -17,7 +17,6 @@ const TSLINT_ERROR_CODE = 100000;

function init(modules: { typescript: typeof ts_module }) {
const ts = modules.typescript;
let tslint = require('tslint');

let codeFixActions = new Map<string, Map<string, tslint.RuleFailure>>();
let registeredCodeFixes = false;
Expand Down Expand Up @@ -67,8 +66,8 @@ function init(modules: { typescript: typeof ts_module }) {

if(config.mockTypeScriptVersion) {
mockRequire('typescript', ts);
tslint = mockRequire.reRequire('tslint');
}
const tslint = require('tslint')

// Set up decorator
const proxy = Object.create(null) as ts.LanguageService;
Expand Down

0 comments on commit 2ba928f

Please sign in to comment.