Skip to content

felixgourdeau/eslint-plugin-forbid-filename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-forbid-filename

npm

Custom ESLint rules to forbid certain filename pattern.

Installation

To add eslint-plugin-forbid-filename to your project, run:

yarn add -D eslint-plugin-forbid-filename

or

npm install --save-dev eslint-plugin-forbid-filename

Usage

  • Add "forbid-filename" to the plugin list of your ESLint config file
  • Add your list of forbidden pattern in the patterns option
  • You can also ignore files with the ignores option

Example

This config will throw an error if you have any .d.ts files in your codebase :

{
  plugins: [
   "forbid-filename"
  ],
  rules: {
    "forbid-filename/match": [
      "error", 
      { 
        patterns: [/\.d\.ts$/],
        ignores: ["next-env.d.ts"],
      }
    ],
  }
}

About

Custom ESLint rules to forbid certain filename pattern.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published