Skip to content

In eslint 4.4.0 name of eslint property in context has changed to _linter #13

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

Merged
merged 1 commit into from
Aug 7, 2017
Merged
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ts eol=lf
/test/fixtures/crlf.vue eol=crlf
5 changes: 4 additions & 1 deletion src/parser-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down