Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixgourdeau/eslint-plugin-forbid-filename
Custom ESLint rules to forbid certain filename pattern.
https://github.com/felixgourdeau/eslint-plugin-forbid-filename
Last synced: about 1 month ago
JSON representation
Custom ESLint rules to forbid certain filename pattern.
- Host: GitHub
- URL: https://github.com/felixgourdeau/eslint-plugin-forbid-filename
- Owner: felixgourdeau
- Created: 2022-08-08T20:42:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-08T21:20:58.000Z (over 2 years ago)
- Last Synced: 2024-10-09T13:10:59.184Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-plugin-forbid-filename
![npm](https://img.shields.io/npm/dm/eslint-plugin-forbid-filename)
Custom ESLint rules to forbid certain filename pattern.
## Installation
To add eslint-plugin-forbid-filename to your project, run:
```shell script
yarn add -D eslint-plugin-forbid-filename
```or
```shell script
npm install --save-dev eslint-plugin-forbid-filename
```### Usage
- Add `"forbid-filename"` to the plugin list of your **[ESLint](https://eslint.org/docs/latest/user-guide/configuring/)** 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 :
```javascript
{
plugins: [
"forbid-filename"
],
rules: {
"forbid-filename/match": [
"error",
{
patterns: [/\.d\.ts$/],
ignores: ["next-env.d.ts"],
}
],
}
}
```