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`.
npm install eslint-plugin-nestjsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure `eslint-plugin-nestjs` in a NestJS project's `.eslintrc.js` file, including recommended configuration and specific rule activation.
Consider migrating to actively maintained NestJS ESLint plugins such as `@darraghor/eslint-plugin-nestjs-typed` or `@elsikora/eslint-plugin-nestjs-typed`.
Regularly review the rules against your current NestJS version and project requirements. Prioritize actively maintained alternatives if compatibility issues arise.
Evaluate the rule sets of alternative, actively developed NestJS ESLint plugins to ensure comprehensive code quality checks for your project.
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'`.
Verify that your `.eslintrc.js` file `module.exports = { ... }` contains a correctly structured configuration object and that all properties are valid.