1.0.0 • Published 3 years ago
eslint-plugin-forbid-filename v1.0.0
eslint-plugin-forbid-filename
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-filenameor
npm install --save-dev eslint-plugin-forbid-filenameUsage
- Add
"forbid-filename"to the plugin list of your ESLint config file - Add your list of forbidden pattern in the
patternsoption - You can also ignore files with the
ignoresoption
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"],
}
],
}
}