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

no-useless-catch throws on catch block without binding #11208

Closed
vsemozhetbyt opened this issue Dec 25, 2018 · 1 comment
Closed

no-useless-catch throws on catch block without binding #11208

vsemozhetbyt opened this issue Dec 25, 2018 · 1 comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@vsemozhetbyt
Copy link
Contributor

Tell us about your environment

  • ESLint Version: v5.11.0
  • Node Version: 11.5.0
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using? default

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

'use strict';

try {
  console.log(true);
} catch {
  console.log(false);
}
eslint --no-eslintrc --parser-options=ecmaVersion:2019 --rule "no-useless-catch: 2" test.js

What did you expect to happen?

No errors.

What actually happened? Please include the actual, raw output from ESLint.

TypeError: Cannot read property 'type' of null
    at CatchClause (eslint\lib\rules\no-useless-catch.js:30:32)
    at listeners.(anonymous function).forEach.listener (eslint\lib\util\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (eslint\lib\util\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (eslint\lib\util\node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (eslint\lib\util\node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (eslint\lib\util\node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (eslint\lib\code-path-analysis\code-path-analyzer.js:632:23)
    at nodeQueue.forEach.traversalInfo (eslint\lib\linter.js:750:28)
    at Array.forEach (<anonymous>)
@vsemozhetbyt vsemozhetbyt added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Dec 25, 2018
@vsemozhetbyt vsemozhetbyt changed the title no-useless-catch throw on catch block without binding no-useless-catch throws on catch block without binding Dec 25, 2018
@aladdin-add aladdin-add added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Dec 25, 2018
@aladdin-add
Copy link
Member

thanks for the report! it could be fixed by #11205

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jun 24, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

2 participants