Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

no-unnecessary-class: false positive with decorated classes #494

Closed
unlight opened this issue Aug 24, 2018 · 4 comments
Closed

no-unnecessary-class: false positive with decorated classes #494

unlight opened this issue Aug 24, 2018 · 4 comments
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Milestone

Comments

@unlight
Copy link

unlight commented Aug 24, 2018

Very common case in nestjs framework.

@Module({
    controllers: [HelloController],
    providers: [],
})
export class HelloModule {}
@JoshuaKGoldberg JoshuaKGoldberg added Status: Accepting PRs Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Type: Rule Feature Adding a feature to an existing rule. labels Aug 24, 2018
@JoshuaKGoldberg
Copy link

Indeed! It'd be great to have a feature on the rule to allow decorated classes.

@IllusionMH
Copy link
Contributor

IllusionMH commented Oct 2, 2018

As I can see - no-unnecessary-class is part of core rules. (no-stateless-class was deprecated in favor of core rule)

@JoshuaKGoldberg maybe it make sense to create feature request in palantir/tslint repo? I can do it if needed.

To avoid error in provided case - it is possible to use "allow-empty-class" option, it will remove error is this case (but no error for classes with decorators)

@JoshuaKGoldberg
Copy link

Indeed, thanks for pointing this out @IllusionMH!

Closing this issue in favor of us deprecating no-unnecessary-class.

@JoshuaKGoldberg
Copy link

JoshuaKGoldberg commented Oct 2, 2018

Also see palantir/tslint#1142 and #504

@JoshuaKGoldberg JoshuaKGoldberg modified the milestones: 6.0.0-beta0, None Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Projects
None yet
Development

No branches or pull requests

3 participants