12.1.0 β€’ Published 2 months ago

@putout/plugin-remove-empty v12.1.0

Weekly downloads
2,955
License
MIT
Repository
github
Last release
2 months ago

@putout/plugin-remove-empty NPM version

🐊Putout plugin adds ability to find and remove:

  • empty blocks;
  • empty static blocks;
  • empty patterns;
  • empty imports;
  • empty arguments;
  • empty exports;

Install

npm i @putout/plugin-remove-empty

Rules

{
    "rules": {
        "remove-empty/block": "on",
        "remove-empty/static-block": "on",
        "remove-empty/pattern": "on",
        "remove-empty/nested-pattern": "on",
        "remove-empty/argument": "on",
        "remove-empty/export": "on",
        "remove-empty/import": ["on", {
            "ignore": []
        }]
    }
}

block

-if (2 > 3) {}

static-block

Check it out in 🐊Putout Editor.

class Hello {
-    static {
-    }
}

pattern

-const [] = array;
-const {} = object;

nested-pattern

❌ Example of incorrect code

export const func = (param) => {
    const {
        a: {
        },
        c,
    } = param;
    
    return c;
};

βœ… Example of correct code

export const func = (param) => {
    const {c} = param;
    return c;
};

export

-export {};

import

-import 'abc';

arguments

Checkout in 🐊Putout Editor.

❌ Example of incorrect code

const create = ({} = {}) => 'hello';

module.exports = ({rule, plugin, msg, options}, {}) => {};

const a = {
    EmptyStatement({}) {},
};

βœ… Example of correct code

const create = () => 'hello';

module.exports = ({rule, plugin, msg, options}) => {};

const a = {
    EmptyStatement() {},
};

License

MIT

12.0.0

2 months ago

12.1.0

2 months ago

11.0.0

6 months ago

10.3.0

12 months ago

10.4.0

11 months ago

10.0.0

1 year ago

10.1.0

1 year ago

10.2.0

1 year ago

9.2.0

2 years ago

9.1.0

2 years ago

9.0.0

2 years ago

8.1.0

2 years ago

8.2.0

2 years ago

8.0.0

2 years ago

6.1.0

2 years ago

7.0.0

2 years ago

7.1.0

2 years ago

6.0.0

3 years ago

5.5.0

3 years ago

5.4.1

3 years ago

5.4.0

3 years ago

5.3.0

4 years ago

5.2.0

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.9.0

5 years ago

2.8.0

5 years ago

2.7.0

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.0

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago