darraghoriordan / eslint-plugin-nestjs-typed

Some eslint rules for working with NestJs projects
http://www.darraghoriordan.com
171 stars 34 forks source link

fix: fixed provider maps and non-factory decorators #31

Closed darraghoriordan closed 2 years ago

darraghoriordan commented 2 years ago

This fixes https://github.com/darraghoriordan/eslint-plugin-nestjs-typed/issues/30

Non-factory decorators work ok with the decorator rules e.g.

// both of these decorators work OK now

@NonFactoryDecorator
@FactoryDecorator()
class MyProvider {}

======

Fixes crashing with https://github.com/darraghoriordan/eslint-plugin-nestjs-typed/issues/29

But doesn't fix the main issue that you can assign providers in many ways. This rule only supports ArrayExpressions

// This works ok
const providers = [ExampleProviderIncludedInModule];

@Module({
    imports: [],
    providers: [MyProvider],
})
export class ProviderArrayModule {}
// the rule will not detect this type of assignment

const providers = [ExampleProviderIncludedInModule];

@Module({
    imports: [],
    providers: providers,
})
export class ProviderArrayModule {}
darraghoriordan commented 2 years ago

:tada: This PR is included in version 3.11.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: