Closed warpech closed 4 years ago
We have agreed with @tomalec that this is nice, but instead of replacing _pseudoPrivate
methods by the same name without underscore, we can make them private by using Symbols (https://medium.com/front-end-weekly/private-methods-in-es6-and-writing-your-own-db-b2e30866521f).
Closing because this PR turned out to be not needed
Noone asked for this, but @tomalec WDYT of using ESLint in all our projects?
This PR shows sample change that uses ESLint. ESLint has a ton of cool options. I didn't bother checking them all, just used official AirBnb JS style configuration https://www.npmjs.com/package/eslint-config-airbnb-base, which seems to be the most popular.
It allowed me to detect some problems, e.g.:
key
in the loop https://github.com/Palindrom/JSONPatcherProxy/blob/909b8f71111d132275cb93fe3920cf8df01b01a8/src/jsonpatcherproxy.js#L236primitiveOrProxifiedNewValue
in https://github.com/Palindrom/JSONPatcherProxy/pull/50/files#diff-3bfa726203c6cb018f2321c18ca9298eR95I think all these changes indeed lead to writing code that's easier to read and maintain.
Alternatively, we could perhaps use https://standardjs.com/ which is used by many folks. It is kind of pre-configured, non-discussable flavor of ESLint.This is done in another PR, see: https://github.com/Palindrom/JSONPatcherProxy/pull/51