`no-useless-undefined`: `undefined` removed from compare functions
See original GitHub issuetest('should be undefined', t => {
t.is(foo, undefined);
})
if (Object.is(foo, undefined)) {}
We are not breaking things, but removing undefined
seems weird
In ava
, t.is(foo)
is also passed.
Funny thing, Object.is(foo)
and Object.is()
returns true.
Question: should we ignore them?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
Javascript - removing undefined fields from an object [duplicate]
A one-liner using ES6 arrow function and ternary operator: Object.keys(obj).forEach(key => obj[key] === undefined ? delete obj[key] : {});.
Read more >eslint-plugin-unicorn - npm
(fixable); consistent-function-scoping - Move function definitions to the highest ... no-useless-undefined - Disallow useless undefined .
Read more >eslint-plugin-unicorn/readme.md - UNPKG
- [no-unused-properties](docs/rules/no-unused-properties.md) - Disallow unused object properties. 131, - [no-useless-undefined](docs/rules/no-useless-undefined ...
Read more >eslint-plugin-unicorn - npm Package Health Analysis - Snyk
consistent-function-scoping, Move function definitions to the highest possible scope. ... no-typeof-undefined, Disallow comparing undefined using typeof .
Read more >eslint-plugin-unicorn | Yarn - Package Manager
Name Description 💼 🚫 🔧 💡
consistent‑destructuring Use destructured variables over properties. ✓ 🔧 💡
custom‑error‑definition Enforce correct Error subclassing. ✓ 🔧
empty‑brace‑spaces Enforce no spaces...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I personally prefer ignoring calls with 1 or 2 parameters whose name contain
is
,equal
,equals
orbe
as a whole “camelCase section”.That’s why I propose, just remove
auto-fix
, if you really want, we still have suggestion and you can alsoeslint-disable
.