添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 [explicit-function-return-type] Decorators being reported ESLint: Missing return type on function #2842 [explicit-function-return-type] Decorators being reported ESLint: Missing return type on function #2842 abrarazeem opened this issue Dec 3, 2020 · 1 comment
  • 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/explicit-function-return-type" : [ " error " , { allowExpressions: true
    import { Controller, HttpCode, HttpStatus } from '@nestjs/common'
    import { AppService } from './app.service'
    // Actually it's imported from @nestjs/common package but for the sake of testing and quick glimpse adding here.
    export declare const Get: (path?: string | string[]) => MethodDecorator
    @Controller()
    export class AppController {
      constructor(private readonly appService: AppService) {}
      @Get() // ESLint: Missing return type on function.(@typescript-eslint/explicit-function-return-type)
      @HttpCode(HttpStatus.OK)
      getHello() {
        return this.appService.getHello()
    

    Expected Result
    Decorators shouldn't be reported as missing return type.

    Actual Result

    Missing return type on function.eslint@typescript-eslint/explicit-function-return-type
    

    Versions

    package version