Closed as not planned
Closed as not planned
Description
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 have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Issue Description
Given this setting for @typescript-eslint/no-floating-promises
:
"@typescript-eslint/no-floating-promises": ["error", {
"allowForKnownSafeCalls": [
{ "from": "package", "name": "useNavigate", "package": "react-router" }
]
}]
...I would have thought this code would not produce a lint report:
import { useNavigate } from 'react-router';
const navigate = useNavigate();
navigate('/new/page');
...but it does on my machine:
/Users/josh/repos/repros/index.ts
4:1 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises
Sparked by a #help
question in Discord: https://discord.com/channels/1026804805894672454/1326739019387899974
Reproduction Repository Link
Repro Steps
- clone the repo at that branch
npm install
npm run lint
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
8.20.0 |
TypeScript |
5.7.3 |
ESLint |
9.18.0 |