Closed ntraut closed 5 months ago
Do we do x=undefined
anywhere? I wouldn't... If I want to remove the value of x
, I'd rather do delete x
. I never compare to undefined either, but do if (typeof x === "undefined")
.
You do it in https://github.com/neuroanatomy/BrainBox/blob/39f60a952739db5cb7cd4700cfc672ef25ae97a6/view/atlasmaker/src/atlasmaker.js#L62. I guess the goal is not to delete the property but more to enumerate some properties which will have to be defined after.
hmm... there's maybe a better way of doing it. I think the idea there is to describe the structure of the object. Maybe doing x: null
would be better.
We use the rule
no-undefined
which prevents to set withvar x=undefined
. A roundabout way to achieve the same result is withvar x=void 0
, but we can't do this either because of the ruleno-void
. We are using es6 so undefined problems may occur in only very special cases, shouldn't we authorize the use ofundefined
and set in placeno-global-assign
andno-shadow-restricted-names
like suggested in https://eslint.org/docs/rules/no-undefined?