0.0.1 • Published 3 years ago

@stwime/eslint-plugin-form-elements-have-ids v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

eslint-plugin-form-elements-have-ids

Ensures all common form elements have IDs set

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-form-elements-have-ids:

$ npm install eslint-plugin-form-elements-have-ids --save-dev

Usage

Add form-elements-have-ids to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "form-elements-have-ids"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "form-elements-have-ids/elements-have-ids": 2
    }
}

Supported Rules

elements-have-ids

Configuration:

{
    "rules": {
        "form-elements-have-ids/elements-have-ids": [
             "error",
            {
                //Specify which nodes should be forced to have IDs
                "targetNodes": ["input", "select", "textarea","button"] 
            },
        ]
    }
}
0.0.1

3 years ago