0.0.1 • Published 5 years ago
eslint-plugin-form-elements-have-ids v0.0.1
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-devNext, install eslint-plugin-form-elements-have-ids:
$ npm install eslint-plugin-form-elements-have-ids --save-devUsage
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"]
},
]
}
}