From 27da003331503a4eec3cefd023160589aa37aa35 Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 6 Aug 2017 03:17:54 +0200 Subject: [PATCH] In eslint 4.4.0 name of eslint property in context has changed to _linter --- .gitattributes | 1 + src/parser-services.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index ba071a99..e561ec1e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +*.ts eol=lf /test/fixtures/crlf.vue eol=crlf diff --git a/src/parser-services.ts b/src/parser-services.ts index 9a63b99a..88cdfe70 100644 --- a/src/parser-services.ts +++ b/src/parser-services.ts @@ -29,8 +29,11 @@ function ensureEmitter(context: any): EventEmitter { emitter = new EventEmitter() emitters.set(ast, emitter) + // In eslint 4.4.0 name of this property has changed + const linter = context._linter || context.eslint + // Traverse - context.eslint.on("Program:exit", (node: ESLintProgram) => { + linter.on("Program:exit", (node: ESLintProgram) => { if (node.templateBody != null) { const generator = new NodeEventGenerator(emitter as EventEmitter) traverseNodes(node.templateBody, generator)