Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
JounQin opened this issue Feb 25, 2021 · 1 comment · Fixed by #3160
Closed
3 tasks done

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

JounQin opened this issue Feb 25, 2021 · 1 comment · Fixed by #3160
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JounQin
Copy link
Contributor

JounQin commented Feb 25, 2021

  • 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
@JounQin JounQin added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Feb 25, 2021
@JounQin
Copy link
Contributor Author

JounQin commented Feb 25, 2021

cc @a-tarasyuk

@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Feb 25, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants