quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.55k stars 192 forks source link

12$: Improve diagnostic for myArray[a:b] #1226

Open strager opened 3 months ago

strager commented 3 months ago

For myArray[a:b], we can suggest writing myArray.slice(a, b-a) instead.

Similarly, for myArray[a:], we can suggest writing myArray.slice(a).

Similarly, for myArray[:b], we can suggest writing myArray.slice(0, b).

Jetoson commented 3 weeks ago

@strager may I work on this?