eslint-plugin-index

1.1.7 • Public • Published

☝️ eslint-plugin-index

License: MIT Conventional Commits

ESlint rules to ensure the proper usage of index.js files

Supported rules

rule description recommended
index/only-import-export Allow only import and export statements in index files error
index/forbid Forbid files named index off

Installation and usage

You'll first need to install ESLint:

npm i -D eslint

Next, install eslint-plugin-index:

npm i -D eslint-plugin-index

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

{
  "plugins": ["index"]
}

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

{
  "plugins": ["index"],
  "rules": {
    "index/only-import-export": "error"
    "index/forbid": "off"
  }
}

Or start with the recommended rule set:

{
  "plugins": ["index"],
  "extends": ["plugin:index/recommended"]
}

Package Sidebar

Install

npm i eslint-plugin-index

Weekly Downloads

20,502

Version

1.1.7

License

MIT

Unpacked Size

10.2 kB

Total Files

13

Last publish

Collaborators

  • artlaman