sindresorhus/eslint-plugin-unicorn
More powerful `new-for-builtins`
Closed
#1,835 opened on May 27, 2022
enhancementhelp wanted
Repository metrics
- Stars
- (5,022 stars)
- PR merge metrics
- (Avg merge 1d 16h) (399 merged PRs in 30d)
Description
Currently, new-for-builtins enforce builtins used either call or new.
My idea is to extend this rule to check all builtins.
- Objects like
JSON/Math/Reflect/Temporalshould be neithercallnornew - Objects from global objects like
Intl.DateTimeFormat/Temporal.Now... should also be checked Only fix casesnewandcallresult the sameFunction('')/new Function(''),Error('')/new Error(''), use suggestion for other cases likenew Symbol()(runtime error)