Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: [explicit-function-return-type] typed function expression flagged despite allowTypedFunctionExpressions: true #8023

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@AndreasHae

Description

@AndreasHae

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.3.2&fileType=.ts&code=JYOwLgpgTgZghgYwgAgPICMBWEFgOrBgAWAYgK4i7AD2IyA3gFDLIwUIBcyAFAB5cgyAW3TQAlMgC8APmSCR0RgF9GjBLQDOYZNSwBBDQDU4UYHHQAbCFwzZcBYuUpgadSQ2at2XXlNm%2BAamQARmVVdRAtZBMoA2NTcysbLBx8QlJ2F1oAbQBdKWRszyYWFjZKHz9kQJDPFVzwizgNDWQAUV44IQAHKw8WXUwDEmAICwATZLs0x0zXApLS8s5qqprQlhVPAHpt6IsLHRhkYhRzagA3FAB3aigAa2jWiF5u1Ihx1RYY4dGJqdSDgyzlceQKRVK-UhyF2JyIwFaGiI1DIE2Qon2Fmo1w%2Bnkhy0qMlWQQ2pRULAaKiAA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6RAD2MbMroDNYTMvkoB7JrWiJ8saJKKl0YANrhsORNGhjokADTqNWDdkgBDePDEB3AColEAEwBiQkeKYBRLtOTJPVAx8OEQjbABfcIBddSiIoA&tsconfig=&tokens=false

Repro Code

interfaceObjectWithFunction{func:(x:number)=>number}constobjAsVariable:ObjectWithFunction={func:x=>x+1}constarrAsVariable:ObjectWithFunction[]=[{func:x=>x+1}]classExample{objAsField:ObjectWithFunction={func:x=>x+1}// all of the above work as expectedarrAsField:ObjectWithFunction[]=[{// this should be allowedfunc:x=>x+1}]}

ESLint Config

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

tsconfig

No response

Expected Result

The given code sample should lint without errors.

Actual Result

There is a linting error on line 26:Missing return type on function. 25:7 - 25:13, despite the optionallowTypedFunctionExpressions: true.

Additional Info

I would have liked to check on which version this started occurring, but the online playground apparently doesn't support selecting the tseslint version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething 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


      [8]ページ先頭

      ©2009-2025 Movatter.jp