{"id":13491949,"url":"https://github.com/dukeluo/eslint-plugin-check-file","last_synced_at":"2025-05-14T06:12:16.345Z","repository":{"id":41841530,"uuid":"439649936","full_name":"dukeluo/eslint-plugin-check-file","owner":"dukeluo","description":"ESLint rules for consistent filename and folder. Allows you to enforce a consistent naming pattern for the filename and folder.","archived":false,"fork":false,"pushed_at":"2024-09-24T09:48:21.000Z","size":485,"stargazers_count":540,"open_issues_count":4,"forks_count":20,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-29T17:22:27.845Z","etag":null,"topics":["eslint","eslint-plugin","file","filename","folder","glob-matching","naming-conventions","naming-pattern","path","well-documented"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-check-file","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dukeluo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"huanluo","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2021-12-18T15:30:22.000Z","updated_at":"2024-10-28T11:40:01.000Z","dependencies_parsed_at":"2024-02-20T15:26:51.485Z","dependency_job_id":"131b5f2b-f333-44da-b876-41db678f6597","html_url":"https://github.com/dukeluo/eslint-plugin-check-file","commit_stats":{"total_commits":199,"total_committers":9,"mean_commits":22.11111111111111,"dds":"0.045226130653266305","last_synced_commit":"e2f4ccd5fc7f6905f1c71b289efa8a4320aaff3a"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dukeluo%2Feslint-plugin-check-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dukeluo%2Feslint-plugin-check-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dukeluo%2Feslint-plugin-check-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dukeluo%2Feslint-plugin-check-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dukeluo","download_url":"https://codeload.github.com/dukeluo/eslint-plugin-check-file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248389442,"owners_count":21095590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","eslint-plugin","file","filename","folder","glob-matching","naming-conventions","naming-pattern","path","well-documented"],"created_at":"2024-07-31T19:01:01.802Z","updated_at":"2025-05-14T06:12:16.338Z","avatar_url":"https://github.com/dukeluo.png","language":"JavaScript","funding_links":["https://ko-fi.com/huanluo","https://github.com/sponsors/dukeluo"],"categories":["JavaScript","eslint"],"sub_categories":[],"readme":"# eslint-plugin-check-file\n\n[![NPM Version][npm-image]][downloads-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![NPM License][license-image]][downloads-url]\n[![Test Workflow Status][test-workflow-image]][workflow-url]\n[![Test Coverage][test-coverage-image]][test-coverage-url]\n[![Follow Author on X][x-follow-image]][x-follow-url]\n\nAn 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.\n\n## Installation\n\nYou'll first need to install [ESLint](https://eslint.org/):\n\n```sh\nnpm i eslint --save-dev\n```\n\nNext, install\n`eslint-plugin-check-file`:\n\n```sh\nnpm install eslint-plugin-check-file --save-dev\n```\n\n## Usage\n\nThis plugin supports ESLint's [flat configuration](https://eslint.org/docs/latest/use/configure/configuration-files). Here's a complete example:\n\n```javascript\nimport checkFile from 'eslint-plugin-check-file';\n\nexport default [\n  {\n    // optional: add this processor to files which not processed by other processors but still require linting\n    files: ['**/*.yaml', '**/*.webp'],\n    processor: 'check-file/eslint-processor-check-file',\n  },\n  {\n    files: ['src/**/*.*'],\n    plugins: {\n      'check-file': checkFile,\n    },\n    rules: {\n      'check-file/no-index': 'error',\n      'check-file/filename-blocklist': [\n        'error',\n        {\n          '**/*.model.ts': '*.models.ts',\n          '**/*.util.ts': '*.utils.ts',\n        },\n      ],\n      'check-file/folder-match-with-fex': [\n        'error',\n        {\n          '*.test.{js,jsx,ts,tsx}': '**/__tests__/',\n          '*.styled.{jsx,tsx}': '**/components/',\n        },\n      ],\n      'check-file/filename-naming-convention': [\n        'error',\n        {\n          '**/*.{jsx,tsx}': 'PASCAL_CASE',\n          '**/*.{js,ts}': 'CAMEL_CASE',\n        },\n      ],\n      'check-file/folder-naming-convention': [\n        'error',\n        {\n          'src/components/*/': 'PASCAL_CASE',\n          'src/!(components)/**/!(__tests__)/': 'CAMEL_CASE',\n        },\n      ],\n    },\n  },\n];\n```\n\n## Supported Rules\n\n- [check-file/no-index](docs/rules/no-index.md): A file cannot be named \"index\"\n- [check-file/filename-blocklist](docs/rules/filename-blocklist.md): Blocklist filenames by pattern\n- [check-file/folder-match-with-fex](docs/rules/folder-match-with-fex.md): Enforce a consistent naming pattern for folder names for specified files\n- [check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for filenames for specified files\n- [check-file/folder-naming-convention](docs/rules/folder-naming-convention.md): Enforce a consistent naming pattern for folder names for specified folders\n\n## Version Compatibility\n\nVersion 3.x and above only support ESLint's flat configuration. For legacy configuration support, please use version 2.x.\n\n## Support\n\nIf you find this plugin helpful, consider supporting the project:\n\n[![GitHub Sponsors][github-sponsors-image]][github-sponsors-url]\n\n[![Ko-fi][ko-fi-image]][ko-fi-url]\n\n[npm-image]: https://img.shields.io/npm/v/eslint-plugin-check-file.svg\n[downloads-image]: https://img.shields.io/npm/dm/eslint-plugin-check-file.svg\n[license-image]: https://img.shields.io/npm/l/eslint-plugin-check-file\n[test-workflow-image]: https://img.shields.io/github/actions/workflow/status/dukeluo/eslint-plugin-check-file/test.yml?label=test\n[test-coverage-image]: https://img.shields.io/codecov/c/gh/dukeluo/eslint-plugin-check-file\n[ko-fi-image]: https://ko-fi.com/img/githubbutton_sm.svg\n[x-follow-image]: https://img.shields.io/badge/follow-@ihuanluo-black\n[downloads-url]: https://www.npmjs.com/package/eslint-plugin-check-file\n[workflow-url]: https://github.com/dukeluo/eslint-plugin-check-file/actions\n[test-coverage-url]: https://app.codecov.io/gh/dukeluo/eslint-plugin-check-file\n[ko-fi-url]: https://ko-fi.com/huanluo\n[x-follow-url]: https://x.com/ihuanluo\n[github-sponsors-image]: https://img.shields.io/github/sponsors/dukeluo?label=Sponsor%20me%20on%20GitHub%20Sponsors\n[github-sponsors-url]: https://github.com/sponsors/dukeluo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdukeluo%2Feslint-plugin-check-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdukeluo%2Feslint-plugin-check-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdukeluo%2Feslint-plugin-check-file/lists"}