eslint-plugin-no-empty-blocks

An extended version of the `no-empty` rule that adds an option to allow empty catch blocks.

ESLint's native no-empty rule already supports the allowEmptyCatch option.
Last updated 11 years ago by alex-shnayder .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-plugin-no-empty-blocks 
SYNC missed versions from official npm registry.

eslint-plugin-no-empty-blocks

An ESLint rule for eliminating empty block statements. It is an extended version of the no-empty rule that allows empty catch blocks.

Why Use It

ESLint has the built-in no-empty rule that is aimed at eliminating empty block statements. It throws a warning at empty catch blocks such as this one:

try {
  doSomething();
} catch(e) {}

But this technique can be useful for ignoring errors, and this plugin provides an option to allow it.

Usage

Add no-empty-blocks to the plugins section of your .eslintrc:

{
  "plugins": [
    "no-empty-blocks"
  ]
}

Turn off the no-empty rule:

{
  "rules": {
    "no-empty": 0
  }
}

Current Tags

  • 0.0.2                                ...           latest (11 years ago)

2 Versions

  • 0.0.2 [deprecated]           ...           11 years ago
  • 0.0.1 [deprecated]           ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (0)
None
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |