eslint-plugin-sort-react-dependency-arrays

0.3.0 • Public • Published

eslint-plugin-sort-react-dependency-arrays

ESLint plugin to enforce alphanumerically sorted React hook dependency arrays.

Works with --fix.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-sort-react-dependency-arrays:

npm install eslint-plugin-sort-react-dependency-arrays --save-dev

Usage

Add sort-react-dependency-arrays to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "sort-react-dependency-arrays"
    ]
}

Then enable the rule under the rules section.

{
    "rules": {
        "sort-react-dependency-arrays/sort": "error"
    }
}

/eslint-plugin-sort-react-dependency-arrays/

    Package Sidebar

    Install

    npm i eslint-plugin-sort-react-dependency-arrays

    Weekly Downloads

    1,356

    Version

    0.3.0

    License

    none

    Unpacked Size

    8.94 kB

    Total Files

    11

    Last publish

    Collaborators

    • stevensacks