0.1.0 • Published 6 months ago

@n7e/eslint-plugin-spacing-rules v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Spacing Rules

A set of augmented spacing rules.

Rules

array-bracket-spacing

Behaves exactly like array-bracket-spacing but adds an option to invert the rule for destructuring assignments.

The following line is valid with the following configuration:

const [ one, two, three ] = [1, 2, 3];
{
    "plugins": [
        "@n7e/spacing-rules"
    ],
    "rules": {
        "@n7e/spacing-rules/array-bracket-spacing": [
            "error",
            "never",
            {
                "destructuringAssignments": true
            }
        ]
    }
}

object-curly-spacing

Behaves exactly like object-curly-spacing but adds an option to invert the rule for destructuring assignments as well as exports.

The following line is valid with the following configuration:

const { one, two, three } = {one: 1, two: 2, three: 3};
{
    "plugins": [
        "@n7e/spacing-rules"
    ],
    "rules": {
        "@n7e/spacing-rules/object-curly-spacing": [
            "error",
            "never",
            {
                "destructuringAssignments": true
            }
        ]
    }
}

And the following line is valid with the following configuration:

export { one, two, three };
{
    "plugins": [
        "@n7e/spacing-rules"
    ],
    "rules": {
        "@n7e/spacing-rules/object-curly-spacing": [
            "error",
            "never",
            {
                "exports": true
            }
        ]
    }
}