{"id":14978224,"url":"https://github.com/aashutoshrathi/eslint-plugin-nestjs-orm","last_synced_at":"2025-10-28T08:31:53.695Z","repository":{"id":218993454,"uuid":"747868762","full_name":"aashutoshrathi/eslint-plugin-nestjs-orm","owner":"aashutoshrathi","description":"Guardrails to prevent bad practices or do some serious mistakes when using NestJS Moongose or ORMs.","archived":false,"fork":false,"pushed_at":"2024-09-27T04:19:40.000Z","size":312,"stargazers_count":7,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-29T01:03:53.728Z","etag":null,"topics":["eslint","eslint-plugin","eslint-rule","nestjs","nestjs-mongoose"],"latest_commit_sha":null,"homepage":"http://eslint-plugin-nestjs-orm.aashutosh.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aashutoshrathi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-01-24T19:55:38.000Z","updated_at":"2024-09-27T04:19:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"bfc1d96c-a249-42cc-b5b4-32bbab2e00b5","html_url":"https://github.com/aashutoshrathi/eslint-plugin-nestjs-orm","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.03703703703703709,"last_synced_commit":"9ecebe415ded5b5f41deadff712ef637b55d38e5"},"previous_names":["aashutoshrathi/eslint-plugin-nestjs-orm"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aashutoshrathi%2Feslint-plugin-nestjs-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aashutoshrathi%2Feslint-plugin-nestjs-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aashutoshrathi%2Feslint-plugin-nestjs-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aashutoshrathi%2Feslint-plugin-nestjs-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aashutoshrathi","download_url":"https://codeload.github.com/aashutoshrathi/eslint-plugin-nestjs-orm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859903,"owners_count":16556031,"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","eslint-rule","nestjs","nestjs-mongoose"],"created_at":"2024-09-24T13:57:05.971Z","updated_at":"2025-10-28T08:31:53.314Z","avatar_url":"https://github.com/aashutoshrathi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-nestjs-orm\n\n[![npm-badge](https://img.shields.io/npm/v/eslint-plugin-nestjs-orm.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-nestjs-orm)\n![GitHub stars](https://img.shields.io/github/stars/aashutoshrathi/eslint-plugin-nestjs-orm.svg?style=flat-square)\n[![npm](https://img.shields.io/npm/dt/eslint-plugin-nestjs-orm.svg?style=flat-square)](https://www.npmjs.com/package/eslint-plugin-nestjs-orm)\n\n\nGuardrails to prevent bad practices or do some serious mistakes when using NestJS Moongose or ORMs.\n\n## Motivation 💡\n\nNo one likes unused variables, and we remove them.\nBut with Mongoose there is a catch, if you attach inject model to non-model variable accidentally, you will get no error, but you will get a bug. This plugin will help you to avoid this.\n\nOne such incident is shown below:\n\n| Before | After |\n| :---: | :---: |\n| \u003cimg alt=\"Before\" src=\"https://s3.ap-south-1.amazonaws.com/shared.aashutosh.dev/eslint-rule-gif.gif\"\u003e | \u003cimg alt=\"After\" src=\"https://s3.ap-south-1.amazonaws.com/shared.aashutosh.dev/after-eslint.gif\"\u003e |\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 `eslint-plugin-nestjs-orm`:\n\n```sh\nnpm install eslint-plugin-nestjs-orm --save-dev\n```\n\n## Usage 🚀\n\nAdd `nestjs-orm` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n{\n    \"plugins\": [\n        \"nestjs-orm\"\n    ]\n}\n```\n\nThen configure the rules you want to use under the rules section.\n\n```json\n{\n    \"rules\": {\n        \"nestjs-orm/mongoose-no-bad-model-injection\": \"error\"\n    }\n}\n```\n\n## Tools Used 💪🏻\n\n- [AST Explorer](https://astexplorer.net/)\n- [ESLint Developer Guide](https://eslint.org/docs/developer-guide/working-with-rules)\n- [TypeScript ESLint Docs](https://typescript-eslint.io/developers/custom-rules)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faashutoshrathi%2Feslint-plugin-nestjs-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faashutoshrathi%2Feslint-plugin-nestjs-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faashutoshrathi%2Feslint-plugin-nestjs-orm/lists"}