npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@elsikora/eslint-plugin-nestjs-typed

v3.0.1

Published

ESLint plugin for NestJS Typed

Downloads

758

Readme

📚 Table of Contents

📖 Description

ESLint-Plugin-NestJS-Typed is a specialized ESLint plugin designed to enhance the development experience in NestJS applications by providing strict type checking and enforcing best practices. It helps catch common mistakes, ensures consistent API documentation, and maintains code quality across your NestJS projects. The plugin is particularly useful for teams working on large-scale NestJS applications where type safety and consistent patterns are crucial.

🚀 Features

  • Comprehensive set of NestJS-specific ESLint rules
  • Strict type checking for Controllers and Injectable services
  • Automated validation of Swagger/OpenAPI documentation
  • Detection of missing injectable dependencies
  • Enforcement of consistent API documentation patterns
  • Validation of proper decorator usage
  • Array type checking and validation
  • Enum handling best practices
  • Guard implementation verification
  • Custom validation rules support

🛠 Installation

# Using npm
npm install --save-dev eslint-plugin-nestjs-typed

# Using yarn
yarn add -D eslint-plugin-nestjs-typed

# Using pnpm
pnpm add -D eslint-plugin-nestjs-typed

💡 Usage

Basic Configuration

Add the plugin to your .eslintrc.js:

module.exports = {
  plugins: ['@elsikora/nestjs-typed'],
  extends: [
    'plugin:@elsikora/nestjs-typed/recommended'
  ]
}

Usage with TypeScript

Ensure your tsconfig.json has the following options:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

Individual Rule Configuration

module.exports = {
  rules: {
    '@elsikora/nestjs-typed/injectable-should-be-provided': ['error', {
      src: ['src/**/*.ts'],
      filterFromPaths: ['node_modules', '.test.', '.spec.']
    }],
    '@elsikora/nestjs-typed/api-method-should-specify-api-response': 'error',
    '@elsikora/nestjs-typed/controllers-should-supply-api-tags': 'error'
  }
}

Working with Swagger/OpenAPI

Example of proper documentation:

@ApiTags('Users')
@Controller('users')
export class UsersController {
  @Get()
  @ApiOperation({ summary: 'Get all users' })
  @ApiOkResponse({ type: [UserDto] })
  async getUsers(): Promise<UserDto[]> {
    return this.usersService.findAll();
  }
}

Custom Validation Rules

class CreateUserDto {
  @ApiProperty()
  @IsString()
  @IsDefined()
  name: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsEmail()
  email?: string;
}

Advanced Guard Usage

@Controller('protected')
@UseGuards(AuthGuard())
export class ProtectedController {
  @Get()
  @ApiOperation({ summary: 'Protected endpoint' })
  @ApiOkResponse({ type: String })
  getProtectedData(): string {
    return 'Protected data';
  }
}

🛣 Roadmap

| Task / Feature | Status | |---------------|--------| | Future development plans include: | 🚧 In Progress | | - Support for custom decorators validation | 🚧 In Progress | | - Integration with more NestJS features | 🚧 In Progress | | - Additional rules for microservices architecture | 🚧 In Progress | | - Performance optimization for large codebases | 🚧 In Progress | | - Extended OpenAPI/Swagger validation rules | 🚧 In Progress | | - Custom rule creation helpers | 🚧 In Progress | | Completed tasks from CHANGELOG: | | | 989a57e: chore(ci): streamline release workflow | ✅ Done | | e9c5d16: chore(package): update publishConfig for provenance | ✅ Done | | 3c669e8: chore(project-setup): remove obsolete configuration and setup files | ✅ Done |

❓ FAQ

Frequently Asked Questions

Q: Does this plugin work with NestJS v8 and v9? A: Yes, the plugin is compatible with both NestJS v8 and v9.

Q: Can I use this with other ESLint plugins? A: Yes, this plugin works well alongside other ESLint plugins and configurations.

Q: How does it handle custom decorators? A: The plugin provides options to configure custom decorator validation through rule configuration.

Q: Will this plugin affect build performance? A: The plugin is designed to be performant, but complex rules may add minimal overhead to the linting process.

🔒 License

This project is licensed under MIT License - Copyright (c) 2024 ElsiKora.

📋 Changelog

See CHANGELOG.md for details.