Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.

License

NotificationsYou must be signed in to change notification settings

dukeluo/eslint-plugin-check-file

Repository files navigation

NPM VersionNPM DownloadsNPM LicenseTest Workflow StatusTest CoverageFollow Author on X

An ESLint plugin that enforces consistent naming conventions for files and folders in your project. It helps maintain a clean and organized codebase by allowing you to define and enforce specific patterns for filenames and directory structures.

Installation

You'll first need to installESLint:

npm i eslint --save-dev

Next, installeslint-plugin-check-file:

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

Usage

This plugin supports ESLint'sflat configuration. Here's a complete example:

importcheckFilefrom'eslint-plugin-check-file';exportdefault[{// optional: add this processor to files which not processed by other processors but still require lintingfiles:['**/*.yaml','**/*.webp'],processor:'check-file/eslint-processor-check-file',},{files:['src/**/*.*'],plugins:{'check-file':checkFile,},rules:{'check-file/no-index':'error','check-file/filename-blocklist':['error',{'**/*.model.ts':'*.models.ts','**/*.util.ts':'*.utils.ts',},],'check-file/folder-match-with-fex':['error',{'*.test.{js,jsx,ts,tsx}':'**/__tests__/','*.styled.{jsx,tsx}':'**/components/',},],'check-file/filename-naming-convention':['error',{'**/*.{jsx,tsx}':'PASCAL_CASE','**/*.{js,ts}':'CAMEL_CASE',},],'check-file/folder-naming-convention':['error',{'src/components/*/':'PASCAL_CASE','src/!(components)/**/!(__tests__)/':'CAMEL_CASE',},],},},];

Supported Rules

Version Compatibility

Version 3.x and above only support ESLint's flat configuration. For legacy configuration support, please use version 2.x.

Support

If you find this plugin helpful, consider supporting the project:

GitHub Sponsors

Ko-fi

About

ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

[8]ページ先頭

©2009-2025 Movatter.jp