@putout/plugin-apply-consistent-blocks
🐊Putout plugin adds ability to apply consistent blocks
Last updated 2 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-apply-consistent-blocks 
SYNC missed versions from official npm registry.

@putout/plugin-apply-consistent-blocks NPM version

A block statement is used to group zero or more statements. The block is delimited by a pair of braces ("curly braces") and contains a list of zero or more statements and declarations.

(c) MDN

????Putout plugin adds ability to apply consistent blocks. Check out in ????Putout Editor. Merged to @putout/plugin-conditions.

Install

npm i @putout/plugin-apply-consistent-blocks

Rule

{
    "rules": {
        "apply-consistent-blocks": "on"
    }
}

❌ Example of incorrect code

if (a > 3) {
    m();
}

if (a > 3)
    b = 5;
else {
    b = 6;
}

if (a > 3)
    b = 5;
else {
    b = 6;
    fn();
}

✅ Example of correct code

if (a > 3)
    m();

if (a > 3)
    b = 5;
else
    b = 6;

if (a > 3) {
    b = 5;
} else {
    b = 6;
    fn();
}

License

MIT

Current Tags

  • 1.2.1                                ...           latest (2 years ago)

4 Versions

  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |