Skip to content

luizwbr/eslint-plugin-check-ids-in-elements-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-check-ids-in-elements-jsx

Ensures all configured elements have IDs set

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-check-ids-in-elements-jsx:

$ npm install eslint-plugin-check-ids-in-elements-jsx --save-dev

Usage

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

{
    "plugins": [
        "check-ids-in-elements"
    ]
}

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

{
    "rules": {
        "check-ids-in-elements-jsx/enforce-ids": 2
    }
}

Supported Rules

check-ids-in-elements

Configuration:

{
    "rules": {
        "check-ids-in-elements-jsx/enforce-ids": [
             "error",
            {
                /* Specify which nodes should be forced to have IDs */
                "targetNodes": ["input", "select", "textarea","button","Bx.Input"] 
            },
        ]
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published