npm.io
1.0.1 • Published 3 years ago

eslint-plugin-file-contains

Licence
MIT
Version
1.0.1
Deps
3
Size
8 kB
Vulns
0
Weekly
0

eslint-plugin-file-contains

NPM Version NPM Downloads

ESLint rules for ensuring files have consistent usage of desired features. Allows you to enforce usage of imports across various file locations.

Installation

You'll first need to install ESLint:

npm install eslint --save-dev

Next, install eslint-plugin-file-contains:

npm install eslint-plugin-file-contains --save-dev

Usage

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

{
  "plugins": ["check-file"]
}

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

{
  "rules": {
    "file-contains/every-file-imports": [
      "error",
      {
        "**/*.test.{js,jsx,ts,tsx}": "jest-axe",
        "**/*.{jsx,tsx}": "react"
      }
    ]
  }
}

Supported Rules

Keywords