{"id":14978262,"url":"https://github.com/codelytv/eslint-plugin-hexagonal-architecture","last_synced_at":"2025-04-04T09:06:23.075Z","repository":{"id":59145131,"uuid":"526244164","full_name":"CodelyTV/eslint-plugin-hexagonal-architecture","owner":"CodelyTV","description":"A plugin that helps you to enforce hexagonal architecture best practises","archived":false,"fork":false,"pushed_at":"2022-09-23T11:17:42.000Z","size":206,"stargazers_count":301,"open_issues_count":4,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-04T09:06:17.164Z","etag":null,"topics":["eslint","eslint-plugin","hexagonal","hexagonal-architecture","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-hexagonal-architecture","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodelyTV.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":"2022-08-18T14:24:42.000Z","updated_at":"2025-03-26T00:27:19.000Z","dependencies_parsed_at":"2022-09-13T22:51:22.631Z","dependency_job_id":null,"html_url":"https://github.com/CodelyTV/eslint-plugin-hexagonal-architecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelyTV%2Feslint-plugin-hexagonal-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelyTV%2Feslint-plugin-hexagonal-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelyTV%2Feslint-plugin-hexagonal-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodelyTV%2Feslint-plugin-hexagonal-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodelyTV","download_url":"https://codeload.github.com/CodelyTV/eslint-plugin-hexagonal-architecture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149500,"owners_count":20891954,"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","hexagonal","hexagonal-architecture","javascript","typescript"],"created_at":"2024-09-24T13:57:12.564Z","updated_at":"2025-04-04T09:06:23.051Z","avatar_url":"https://github.com/CodelyTV.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://codely.com\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  🎯 Codely's ESLint Hexagonal Architecture plugin\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/CodelyTV\"\u003e\u003cimg src=\"https://img.shields.io/badge/CodelyTV-OS-green.svg?style=flat-square\" alt=\"Codely Open Source\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://pro.codely.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/CodelyTV-PRO-black.svg?style=flat-square\" alt=\"CodelyTV Courses\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A plugin that helps you to enforce hexagonal architecture best practises. Valid for your JavaScript or TypeScript projects 🤟\n  \u003ca href=\"https://github.com/CodelyTV/eslint-plugin-hexagonal-architecture/stargazers\"\u003eStars are welcome 😊\u003c/a\u003e\n\u003c/p\u003e\n\n## 🤔 What it does\n\n- **Enforce conventional folder naming**: only `domain`, `application` and `infrastructure` are valid folder names (under the glob pattern you specify)\n- **Prevent imports from restricted layers**: \n  - `domain` can only import files from the same folder\n  - `application` can only import from `application` and `domain`\n  - `infrastructure` can import from `application`, `domain` and `infrastructure`\n\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/1331435/188609417-1d51b243-613e-4b87-8c82-b429d8ef5841.png\" alt=\"hexagonal-dependency-rule\" width=\"360\" \u003e\n\u003c/p\u003e\n\n## 👀 How to use\n\n1. Install the dependency\n   ```bash\n   npm install --save-dev eslint-plugin-hexagonal-architecture\n   ```\n2. Add the plugin to your `.eslintrc.js` file:\n    ```js\n    {\n      plugins: [\"hexagonal-architecture\"],\n    }\n    ``` \n3. Enable the rule for the specific folders that will contain your logic using [ESLint's Glob Patterns overrides](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#how-do-overrides-work):\n    ```js\n    {\n      overrides: [\n        {\n          files: [\"contexts/{backend,frontend}/*/src/**/*.ts\"],\n          rules: {\n            \"hexagonal-architecture/enforce\": [\"error\"],\n          },\n        },\n      ]\n    }\n    ```\n\n## 👌 Codely Code Quality Standards\n\nPublishing this package we are committing ourselves to the following code quality standards:\n\n- 🤝 Respect **Semantic Versioning**: No breaking changes in patch or minor versions\n- 🤏 No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose\n- 🎯 **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities\n- ✅ **Tests** as documentation and usage examples\n- 📖 **Well documented ReadMe** showing how to install and use\n- ⚖️ **License favoring Open Source** and collaboration\n\n## 🔀 Related resources\n\n- [🔦 Linting en JavaScript y TypeScript](https://pro.codely.com/library/linting-en-javascript-y-typescript-188432/446893/about/): Used as a template to bootstrap this plugin\n- [🤏 Codely's ESLint + Prettier configuration](https://github.com/CodelyTV/eslint-config-codely): Opinionated linting configuration considering modern TypeScript best practices and providing consistency to your import statements. Valid for your JavaScript or TypeScript projects\n\nOpinionated skeletons ready for different purposes:\n\n- [✨🌱 JavaScript Basic Skeleton](https://github.com/CodelyTV/javascript-basic-skeleton)\n- [🔷🌱 TypeScript Basic Skeleton](https://github.com/CodelyTV/typescript-basic-skeleton)\n- [🔷🕸️ TypeScript Web Skeleton](https://github.com/CodelyTV/typescript-web-skeleton)\n- [🔷🌍 TypeScript API Skeleton](https://github.com/CodelyTV/typescript-api-skeleton)\n- [🔷✨ TypeScript DDD Skeleton](https://github.com/CodelyTV/typescript-ddd-skeleton)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelytv%2Feslint-plugin-hexagonal-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodelytv%2Feslint-plugin-hexagonal-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodelytv%2Feslint-plugin-hexagonal-architecture/lists"}