{"id":13145,"library":"eslint-plugin-nestjs","title":"ESLint Plugin for NestJS","description":"This package, `eslint-plugin-nestjs` (version 1.2.3), provides a set of ESLint rules specifically designed for the NestJS framework. It aims to help developers enforce common best practices and catch potential issues related to NestJS decorators, pipes, and dependency injection patterns. The rules cover areas such as enforcing `ParseIntPipe` for `@Param()`, checking for deprecated API usage, ensuring dependency injection via constructors, and promoting the use of `ValidationPipe` for `@Body` parameters. However, it's crucial to note that the project explicitly states it is a 'Proof of Concept (POC) and is not under development'. This means it lacks active maintenance, bug fixes, or updates to support newer NestJS versions or ESLint configurations, making it potentially outdated and unsuitable for modern NestJS projects. Developers looking for actively maintained NestJS ESLint rules might consider alternatives like `@darraghor/eslint-plugin-nestjs-typed` or `@elsikora/eslint-plugin-nestjs-typed`.","status":"abandoned","version":"1.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/unlight/eslint-plugin-nestjs","tags":["javascript","eslint-plugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-nestjs","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-nestjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-nestjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for any ESLint plugin.","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugins are configured in the `.eslintrc.*` file, not imported via `import` statements in JavaScript/TypeScript code.","wrong":"import nestjsPlugin from 'eslint-plugin-nestjs'","symbol":"plugins: ['nestjs']","correct":"{ plugins: ['nestjs'], extends: ['plugin:nestjs/recommended'] }"},{"note":"The `plugin:` prefix is required to correctly reference a plugin's recommended configuration.","wrong":"extends: ['nestjs/recommended']","symbol":"plugin:nestjs/recommended","correct":"extends: ['plugin:nestjs/recommended']"},{"note":"Individual rules must be prefixed with the plugin name (`nestjs/`) in the `rules` section of the ESLint configuration.","wrong":"rules: { 'parse-int-pipe': 'error' }","symbol":"nestjs/parse-int-pipe","correct":"rules: { 'nestjs/parse-int-pipe': 'error' }"}],"quickstart":{"code":"/* eslint-env node */\nmodule.exports = {\n  root: true,\n  parser: '@typescript-eslint/parser',\n  parserOptions: {\n    project: 'tsconfig.json',\n    sourceType: 'module',\n  },\n  plugins: [\n    'nestjs',\n    '@typescript-eslint',\n  ],\n  extends: [\n    'eslint:recommended',\n    'plugin:@typescript-eslint/recommended',\n    'plugin:nestjs/recommended',\n    'prettier',\n  ],\n  rules: {\n    // Example: Enforce usage of ParseIntPipe for @Param()\n    'nestjs/parse-int-pipe': 'error',\n    // Example: Warn about deprecated API modules\n    'nestjs/deprecated-api-modules': 'warn',\n    // Example: Ensure dependencies are provided via constructor\n    'nestjs/use-dependency-injection': 'error',\n    // Example: Enforce ValidationPipe for @Body parameters\n    'nestjs/use-validation-pipe': ['error', { 'optional': false }],\n    // You can also override rules from the recommended config or other plugins\n    '@typescript-eslint/interface-name-prefix': 'off',\n    '@typescript-eslint/explicit-function-return-type': 'off',\n    '@typescript-eslint/explicit-module-boundary-types': 'off',\n    '@typescript-eslint/no-explicit-any': 'off',\n  },\n  env: {\n    node: true,\n    jest: true,\n  },\n  ignorePatterns: ['.eslintrc.js', 'src/**/*.d.ts'],\n};\n\n// Ensure you have installed:\n// npm install --save-dev eslint eslint-plugin-nestjs @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier prettier","lang":"typescript","description":"Demonstrates how to configure `eslint-plugin-nestjs` in a NestJS project's `.eslintrc.js` file, including recommended configuration and specific rule activation."},"warnings":[{"fix":"Consider migrating to actively maintained NestJS ESLint plugins such as `@darraghor/eslint-plugin-nestjs-typed` or `@elsikora/eslint-plugin-nestjs-typed`.","message":"This project is explicitly marked as 'POC and is not under development'. It has not been updated in 8 years. This means it will not receive bug fixes, security updates, or compatibility patches for newer versions of NestJS, ESLint, or TypeScript. Using it in production environments is highly discouraged.","severity":"breaking","affected_versions":">=1.2.3"},{"fix":"Regularly review the rules against your current NestJS version and project requirements. Prioritize actively maintained alternatives if compatibility issues arise.","message":"Due to lack of maintenance, rules might not be compatible with recent changes or new features introduced in NestJS (e.g., NestJS v8, v9, or later). Rules may produce false positives, false negatives, or simply fail to function as intended on modern NestJS codebases.","severity":"gotcha","affected_versions":">=1.2.3"},{"fix":"Evaluate the rule sets of alternative, actively developed NestJS ESLint plugins to ensure comprehensive code quality checks for your project.","message":"The plugin's ruleset might not cover the latest best practices or common pitfalls that have emerged in the NestJS ecosystem since its last update. Newer, more comprehensive plugins exist that address a wider array of concerns, including advanced dependency injection checks, Swagger/OpenAPI documentation validation, and GraphQL-specific rules.","severity":"gotcha","affected_versions":">=1.2.3"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `nestjs` is listed in the `plugins` array in your `.eslintrc.js` (or similar config file) and that the rule name includes the `nestjs/` prefix, e.g., `'nestjs/parse-int-pipe': 'error'`.","cause":"The `eslint-plugin-nestjs` plugin is installed but not correctly configured in the `plugins` section of `.eslintrc.*` file, or the rule name is mistyped.","error":"ESLint: Definition for rule 'nestjs/parse-int-pipe' was not found."},{"fix":"Verify that your `.eslintrc.js` file `module.exports = { ... }` contains a correctly structured configuration object and that all properties are valid.","cause":"The `.eslintrc.js` file has a syntax error or is not exporting a valid configuration object.","error":"TypeError: Cannot read properties of undefined (reading 'plugins') in .eslintrc.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}