0.1.1 • Published 7 months ago

eslint-plugin-require-sort-like v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

eslint-plugin-require-sort-like

Enforce sorted require declarations within modules.

This plugin was initialized via generator-eslint.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-require-sort-like:

npm install eslint-plugin-require-sort-like --save-dev

Usage

In your configuration file, import the plugin eslint-plugin-require-sort-like and add require-sort-like to the plugins key:

import require-sort-like from "eslint-plugin-require-sort-like";

export default [
    {
        plugins: {
            require-sort-like
        }
    }
];

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

import require-sort-like from "eslint-plugin-require-sort-like";

export default [
    {
        plugins: {
            require-sort-like
        },
        rules: {
            "require-sort-like/duplicates": "error",
            "require-sort-like/sort-declarations": "error",
            "require-sort-like/sort-properties": ["error", {
                "ignoreCase": false,
            }]
        }
    }
];

Development

You can use ESLint Code Explorer to check AST.

Rules

🔧 Automatically fixable by the --fix CLI option.

Name             Description🔧
duplicatesPrevent multiple require declarations from the same package.
sort-declarationsEnforce sorted require declarations within modules.🔧
sort-propertiesSort require properties alphabetically.🔧
0.1.1

7 months ago

0.1.0

7 months ago

0.0.0

7 months ago