Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[explicit-function-return-type] add an exclude list option #4402

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

Closed
dangrussell opened this issue Jan 7, 2022 · 1 comment · Fixed by #4440
Closed

[explicit-function-return-type] add an exclude list option #4402

dangrussell opened this issue Jan 7, 2022 · 1 comment · Fixed by #4440
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@dangrussell
Copy link

Description

Similar advantages to allowedNames on explicit-module-boundary-types and ignoredMethodNames on explicit-member-accessibility

Fail

{
  "@typescript-eslint/explicit-function-return-type": [
    "error",
    {
      "allowedNames": []
    }
  ]
}

ngOnInit() {
    this.initStuff();
}

initStuff(): void {
   this.init = true;
}

Pass

{
  "@typescript-eslint/explicit-function-return-type": [
    "error",
    {
      "allowedNames": ["ngOnInit"]
    }
  ]
}

ngOnInit() {
    this.initStuff();
}

initStuff(): void {
   this.init = true;
}
@dangrussell dangrussell added enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jan 7, 2022
@hadimbj
Copy link

hadimbj commented Jan 7, 2022

Or there are cases like Angular lazy-loading, It doesn't really makes sense to have a return type here. there should a way to exclude these.

const routes: Routes = [
  {
    path: 'items',
    loadChildren: () => import('./items/items.module').then(m => m.ItemsModule)
  }
];

@bradzacher bradzacher added enhancement: plugin rule option New rule option for an existing eslint-plugin rule accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look enhancement: new base rule extension New base rule extension required to handle a TS specific case labels Jan 7, 2022
@bradzacher bradzacher changed the title Rule proposal: explicit-function-return-type should have an exclude list option [explicit-function-return-type] add an exclude list option Jan 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants