question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `ignore-catch` option to `no-empty`

See original GitHub issue

What version of ESLint are you using? v2.7.0

Change proposal I would like to propose an ignore-catch option for the no-empty rule that would not warn for empty catch blocks. This would allow users the option to have have the same behavior as the corresponding JSCS rule disallowEmptyBlocks. The description of said rule is, “Disallows empty blocks (except for catch blocks).”

I’d be willing to make this change if it’s accepted.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
sindresorhuscommented, Apr 6, 2016

Duplicate of https://github.com/eslint/eslint/issues/2808 and #1841. I still think it’s a valid use-case though and it’s obvious now many users agree.

1reaction
nzakascommented, Apr 7, 2016

That sounds fine. Compatibility with JSCS is important for people who are coming over, so I think @kaicataldo’s suggestion is good. The only change I’d make is that we’ve tried to move away from dash-cased option names, so I’d prefer something like:

no-empty: ["error", {
    allowEmptyCatch: true
}]

Where the default is false.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-empty - ESLint - Pluggable JavaScript Linter
This rule disallows empty block statements. This rule ignores block statements which contain a comment (for example, in an empty catch or finally...
Read more >
Reference - Configuration (ES6 and IS7) - support@intershop
Property Default (Development) Type intershop.AuthenticationSecurity.Mode secure_cookie_preferred String intershop.event.messengerClass String intershop.event.multicastAddress 224.1.2.3 String
Read more >
Optional Parameters - IBM
EMPTY|NOEMPTY: Specifies what action is to be taken for the catalog entries for the ... by the setting of the SCRATCH/NOSCRATCH parameter for...
Read more >
Intro(2) - UnixWare 7 Documentation
In the fcntl routine, the setting or removing of record locks on a file cannot be ... Large file support can be added...
Read more >
automatic generation and assessment of source code method ...
Wilcoxon Test Summary of experts and novices After adding the non- ... A line of code is counted if and only if it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found