{"id":23557294,"url":"https://github.com/takuya-nakayasu/eslint-plugin-angular-file-naming","last_synced_at":"2025-04-30T08:05:05.040Z","repository":{"id":57229707,"uuid":"383426347","full_name":"takuya-nakayasu/eslint-plugin-angular-file-naming","owner":"takuya-nakayasu","description":"ESLint plugin for Angular file naming conventions","archived":false,"fork":false,"pushed_at":"2022-11-12T09:48:54.000Z","size":873,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-17T19:03:22.550Z","etag":null,"topics":["angular","eslint","eslint-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takuya-nakayasu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-06T10:17:38.000Z","updated_at":"2023-03-21T09:51:39.000Z","dependencies_parsed_at":"2023-01-21T15:15:25.919Z","dependency_job_id":null,"html_url":"https://github.com/takuya-nakayasu/eslint-plugin-angular-file-naming","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya-nakayasu%2Feslint-plugin-angular-file-naming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya-nakayasu%2Feslint-plugin-angular-file-naming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya-nakayasu%2Feslint-plugin-angular-file-naming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya-nakayasu%2Feslint-plugin-angular-file-naming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takuya-nakayasu","download_url":"https://codeload.github.com/takuya-nakayasu/eslint-plugin-angular-file-naming/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231368165,"owners_count":18366061,"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":["angular","eslint","eslint-plugin"],"created_at":"2024-12-26T14:28:01.672Z","updated_at":"2024-12-26T14:28:09.158Z","avatar_url":"https://github.com/takuya-nakayasu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-angular-file-naming\n\n[![npm version](https://img.shields.io/npm/v/eslint-plugin-angular-file-naming.svg)](https://www.npmjs.com/package/eslint-plugin-angular-file-naming)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Twitter](https://img.shields.io/twitter/follow/takuya_nakayasu?style=social)](https://twitter.com/takuya_nakayasu)\n\nAn ESLint plugin that enforce the filename to have a appropriate suffix (such as `.component.ts`, `.directive.ts`, `.module.ts`, `.pipe.ts`, or `.service.ts`).\n\n**Please note**: This plugin will only lint the filenames of the `.ts` files you are linting with eslint. It will ignore other files that are not linted with eslint.\n\n| File type | Appropriate suffix of the filename |\n| --------- | ---------------------------------- |\n| Component | `.component.ts`                    |\n| Directive | `.directive.ts`                    |\n| Module    | `.module.ts`                       |\n| Pipe      | `.pipe.ts`                         |\n| Service   | `.service.ts`                      |\n\n## Installation\n\n```\nnpm install --save-dev eslint-plugin-angular-file-naming\n```\n\nOr\n\n```\nyarn add --dev eslint-plugin-angular-file-naming\n```\n\n## Usage\n\nModify your `.eslintrc`\n\n```js\n// .eslintrc.json\nmodule.exports = {\n  \"plugins\": [\n    ...,\n    \"angular-file-naming\"\n  ],\n  \"rules\": [\n    ...,\n    \"angular-file-naming/component-filename-suffix\": \"error\",\n    \"angular-file-naming/directive-filename-suffix\": \"error\",\n    \"angular-file-naming/module-filename-suffix\": \"error\",\n    \"angular-file-naming/pipe-filename-suffix\": \"error\",\n    \"angular-file-naming/service-filename-suffix\": \"error\",\n  ]\n  ...,\n}\n```\n\n## Rules\n\n| Rule ID                                                                | Description                                                     |\n| ---------------------------------------------------------------------- | --------------------------------------------------------------- |\n| [component-filename-suffix](./docs/rules/component-filename-suffix.md) | Enforces the file name of components to have a specified suffix |\n| [directive-filename-suffix](./docs/rules/directive-filename-suffix.md) | Enforces the file name of directives to have a specified suffix |\n| [module-filename-suffix](./docs/rules/module-filename-suffix.md)       | Enforces the file name of modules to have a specified suffix    |\n| [pipe-filename-suffix](./docs/rules/pipe-filename-suffix.md)           | Enforces the file name of pipes to have a specified suffix      |\n| [service-filename-suffix](./docs/rules/service-filename-suffix.md)     | Enforces the file name of services to have a specified suffix   |\n\n## Examples\n\nFor example:\n\n```js\n// .eslintrc.json\nmodule.exports = {\n  \"plugins\": [\n    ...,\n    \"angular-file-naming\"\n  ],\n  \"rules\": [\n    ...,\n    \"angular-file-naming/component-filename-suffix\": [\n      \"error\",\n      {\n        \"suffixes\": [\"component\", \"page\", \"view\", \"component.mock\"]\n      }\n    ],\n    \"angular-file-naming/directive-filename-suffix\": \"error\",\n    \"angular-file-naming/module-filename-suffix\": \"error\",\n    \"angular-file-naming/pipe-filename-suffix\": \"error\",\n    \"angular-file-naming/service-filename-suffix\": [\n      \"error\",\n      {\n        \"suffixes\": [\"service\", \"guard\", \"store\", \"service.mock\"]\n      }\n    ],\n  ]\n  ...,\n}\n```\n\nExamples of **incorrect** file name with the above configuration:\n\n```\napp.comp.ts\napp.mock.ts\nsample.ts\ntest.filter.ts\ntest.mock.ts\n```\n\nExample of **correct** file name with the above configuration:\n\n```\napp.component.ts\napp.page.ts\napp.view.ts\napp.component.mock.ts\ntest.directive.ts\napp.module.ts\nsample.pipe.ts\ntest.service.ts\ntest.service.mock.ts\ntest.guard.ts\ntest.store.ts\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya-nakayasu%2Feslint-plugin-angular-file-naming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakuya-nakayasu%2Feslint-plugin-angular-file-naming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya-nakayasu%2Feslint-plugin-angular-file-naming/lists"}