Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1 KB

README.md

File metadata and controls

33 lines (23 loc) · 1 KB

eslint-plugin

npm

This set of ESLint rules is provided to enforce a consistent patterns and practices across all NestJS projects.

Installation

npm install --save @getlarge/eslint-plugin-nestjs-tools

Usage

return-class-instance

This rule enforces that all public Service methods return a class instance of the same return type. The purpose of this rule is to ensure you return class instances instead of plain objects, which is essentials when using the ClassSerializerInterceptor.

In order to use this rule, add it to your ESLint configuration file:

{
  "files": ["*.ts", "*.tsx"],
  "plugins": ["@getlarge/nestjs-tools"],
  "rules": {
    "@getlarge/nestjs-tools/return-class-instance": "error"
  }
}