Repository navigation
Ability to suppress warnings by type #47478
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Apr 8, 2023 +1 to this. Since the
vmESM APIs remain experimental, it'd be great to suppress its warnings when running Jest with native ESM.Reacted by Maciej Holyszko, qb-vajahath, duckboy81, Max Holman, Andrew, Jason Chiang, Sean Juarez, Steven, Paul Shryock and alexHonestly if the command line explicitly turns on an experimental feature I don't see the point of these warning at all.
Reacted by Robbie Speed, ironmoon, Chilli!, Vladimir Grenaderov, Arnau Sanchez Sala, Bastian Klett, Damian Rivas, duckboy81, Max Holman, Andrew and 14 moreI'm going to try to implement this feature soon. Probably will be a couple weeks because of other responsibilities, but unless someone beats me to it I'll try to get this implemented 🚀
Reacted by Charles McNultyReacted by Alexander Kachkaev, Karl Horky, Maciej Holyszko, John Leung, beeman, AⱯ, Kepi, Sean Juarez, Timon van Spronsen, Paul Shryock and 2 more- added a commit that references this issue
on Nov 21, 2023 - added a commit that references this issue
on Nov 23, 2023 - added a commit that references this issue
on Nov 27, 2023 - added 2 commits that reference this issue
on Nov 29, 2023 - added 3 commits that reference this issue
on Dec 11, 2023
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
This issue is a followup on #30810 by @coreyfarrell, but specifically only for warnings of a specific type / topic
What is the problem this feature will solve?
After a team has thoughtfully considered using experimental features of their Node.js version (eg.
fetch) and decided the tradeoffs are acceptable for their project, showing the warnings every time their script runs is often not necessary and can be noisy and confusing, making debugging more arduous.Such a warning, for
fetchin Node.js v18.12.1 (I'm aware that newer versions do not have this warning anymore):Replit demo: https://replit.com/@karlhorky/Nodejs-18121-fetch-experimental-warning
What is the feature you are proposing to solve the problem?
It would be great to be able to disable warnings by:
1. Specific warning code(s)
2. Topic(s)
Prior art / similar APIs
--no-warnings=<cat1>,<cat2>flag, which does not have the capabilities listed hereWhat alternatives have you considered?
Workaround
To suppress the experimental
fetchwarnings likeExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time, this is what we used:package.json{ "scripts": { "start": "node --require ./suppress-experimental-fetch-warnings.js index.js" } }suppress-experimental-fetch-warnings.jsAn alternative would be to add official Node.js documentation (in a "recipes" or "examples" section) with idiomatic suppression example code + configuration that users could copy into their projects for every warning type.