New Linting Rules
summary
A custom linter built by the author flags real issues: typeof null bug, 24 coercion cases with 7 gotchas (rule: never use == true/false and avoid comparing to empty string/0/[]), recommends restrictmode.org to detect unsafe coercions and a letter tool to transpile explicit block-scoping (let) back to ES3/ES5. Advice: name function expressions for readable stack traces, use block scoping for per-iteration let in loops, follow four simple rules for this binding, and prefer object delegation via Object.create over class-style prototype hacks.
AI-written summary · about
chapters (10)
- 0:00Start
- 17:30the seven bad cases
- 25:21put a name on your function expressions
- 26:35using the inline nested functions
- 28:35hoist all your vars to the top of your functions
- 30:01take a look at the man page for block scoping block
- 37:57put a new keyword in front of a function call
- 38:24putting the new keyword in front of a function
- 44:18putting the word prototype in front of inheritance
- 48:48putting properties directly on the objects








