eslint-plugin-full-require

0.0.4 • Public • Published

eslint-plugin-full-require

Eslint check for full require. e.g., lodash.

example

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-full-require:

$ npm install eslint-plugin-full-require --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-full-require globally.

Usage

Add full-require to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "full-require"
    ]
}

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

{
    "rules": {
        "full-require/full-require": ["error", "lodash"]
    }
}
{
    "rules": {
        "full-require/not-allow": ["error", "lodash"]
    }
}

Options

You can assign multiple module in an array, also support glob expressions by minimatch. For example:

{
    "rules": {
        "full-require/full-require": ["error", "lodash", "underscore"],
        "full-require/not-allow": ["error", "lodash/fp/**"]
    }
}

Supported Rules

  • full-require message: Avoid using full require for "{{ module }}".

  • not-allow message: Avoid require: "{{ module }}".

License

MIT

Copyright (c) 2019-present, zhengjiaqi

Package Sidebar

Install

npm i eslint-plugin-full-require

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

191 kB

Total Files

8

Last publish

Collaborators

  • zhengjiaqi