Skip to content
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

"Unexpected linter output" error #465

Closed
dcposch opened this issue Mar 21, 2016 · 7 comments

Comments

@dcposch
Copy link

commented Mar 21, 2016

Error message:

> webtorrent-app@0.0.0 test /home/dc/webtorrent-app
> standard

standard: Unexpected linter output:

TypeError: Cannot read property 'type' of undefined
    at isRedundantSuperCall (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/rules/no-useless-constructor.js:24:38)
    at EventEmitter.checkForConstructor (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/rules/no-useless-constructor.js:52:46)
    at emitOne (events.js:82:20)
    at EventEmitter.emit (events.js:169:7)
    at NodeEventGenerator.enterNode (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/util/node-event-generator.js:42:22)
    at CodePathAnalyzer.enterNode (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:591:23)
    at CommentEventGenerator.enterNode (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/util/comment-event-generator.js:98:23)
    at Controller.controller.traverse.enter (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/lib/eslint.js:839:36)
    at Controller.__execute (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/home/dc/webtorrent-app/node_modules/standard/node_modules/eslint/node_modules/estraverse/estraverse.js:495:28)

If you think this is a bug in `standard`, open an issue: https://github.com/feross/standard/issues
npm ERR! Test failed.  See above for more details.

To reproduce, run npm test (or equivalently, standard) on the following code: webtorrent/webtorrent-desktop@f71343d

@dcposch

This comment has been minimized.

Copy link
Author

commented Mar 21, 2016

Update: looks like this happened because I used the ES6 class keyword.

IMO standard should either support those new ES6 features, or give a more descriptive error message

@feross

This comment has been minimized.

Copy link
Member

commented Mar 24, 2016

@dcposch The code that you linked to has since disappeared. Can you paste an example here? The class keyword should work without crashing eslint, I believe. So, there's probably a bug in eslint somewhere. If you paste your code, I can look at it and file any needed issues / send a pr to eslint.

@dcposch

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

Found it:

class UnplayableError extends Error {
  constructor () {
    this.message = 'Can\'t play any files in torrent'
  }
}
@dcposch

This comment has been minimized.

Copy link
Author

commented Mar 24, 2016

K here's a minimal way to reproduce it.

Works: (standard outputs linter errors, but doesn't crash)

class MyClass extends Error {
  constructor () {
  }
}

Works:

class MyClass {
  constructor () {
    this.n = 0
  }
}

Crashes:

class MyClass extends Error {
  constructor () {
    this.n = 0
  }
}
@feross

This comment has been minimized.

Copy link
Member

commented Mar 24, 2016

This is probably an eslint bug. I opened an issue: eslint/eslint#5662

@feross

This comment has been minimized.

Copy link
Member

commented Mar 24, 2016

Looks like this is fixed on eslint master. Once the version after 2.4.0 is released, we can bump it in standard.

@feross

This comment has been minimized.

Copy link
Member

commented Apr 24, 2016

Bumped eslint to 2.8.0 -- closing this now.

@feross feross closed this Apr 24, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.