Slide 6
Slide 6 text
The purpose of linting
- Reduce the number of code reviews by following the team’s coding principles
for pull requests.
- Learn the latest syntax
- ECMAScript is published every year
- From ES2025
- Promise.try
- import json from "./awesome.json" with { type: "json" }
- new Set([1, 2]).union( new Set([1, 3])) // {1, 2, 3}
- Learn JavaScript and React best practices.
- ❌ Incorrect: const array = new Array(12)
- ✅ Correct: const array = Array.from({ length: 12 })
Reason: When using the Array constructor with one argument,
it's not clear whether the argument is meant to be the length of
the array or the only element.