3 ms·
I'm with you. Though typing `if (a = 1) {}` happens to me sometimes, and const may catch this earlier. I don't use a linter anymore, but I suppose any serious l
by megous 7y ago
I'm with you. Though typing `if (a = 1) {}` happens to me sometimes, and const may catch this earlier. I don't use a linter anymore, but I suppose any serious linter would warn about assignement in a condition, anyway.
- elyobo 7y agoWhy have you stopped using a linter? The popular airbnb eslint rules[1] require the use of const where a variable is not reassigned, which I've occasionally found handy. [1] https://github.com/airbnb/javascript#references--prefer-const https://github.com/airbnb/javascript#references--prefer-cons...