macovidvaccines.com
macovidvaccines.com copied to clipboard
Avoid foo.hasOwnProperty() per eslint:no-prototype-builtins
Instead use the more "fun" and seemingly excessively verbose: Object.prototype.hasOwnProperty.call(foo, "prop")
See https://eslint.org/docs/rules/no-prototype-builtins but basically not all objects need have the methods from Object.prototype in EMCAScript 5.1, and even if they do they can be subtly/maliciously overridden.
This tripped me up because I had eslint set to a stricter mode than we do, with "eslint:recommended"
in my extends
section of .eslintrc.js
.
On the other hand, feel free to tell me to "shove it," and that this is needlessly strict and excessively verbose, and we don't need to worry about it
Or, can this just be reflected in the "eslintConfig" in package.json
?
I don't have a problem with stricter checking. Maybe you should add a
.eslintrc.js
to the project so that we are all using the same standard.
I tend to agree. Perhaps update the PR with the .eslintrc
file so everyone follows the same rules. In the same PR include the fixes required to comply with the new rules (maybe this is the only one?)