Palindrom / JSONPatcherProxy

ES6 proxy powered JSON Object observer that emits JSON patches when changes occur to your object tree.
94 stars 14 forks source link

Experiment: linting with ESLint #50

Closed warpech closed 4 years ago

warpech commented 5 years ago

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.:

I 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

warpech commented 5 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).

warpech commented 4 years ago

Closing because this PR turned out to be not needed