Skip to content

[no-extran-class] allowWithDecorator should ignore other errors #3114

@JounQin

Description

@JounQin
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/no-extran-class": [
      2,
      {
        "allowWithDecorator": true
      }
    ]
  }
}
@NgModule({
  // ...
})
export class AppModule {
  constructor(translate: TranslateService) {
    translate.locale$.subscribe(locale => {
      document.documentElement.setAttribute('lang', locale);
    });
  }
}

Expected Result

Pass

Actual Result

error  Unexpected class with only a constructor  @typescript-eslint/no-extraneous-class

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.15.2
@typescript-eslint/parser 4.15.2
TypeScript 4.1.5
ESLint 7.20.0
node 12.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions