phin
phin copied to clipboard
Add eslint to catch errors and enforce style
Fixes these issues:
- https://eslint.org/docs/rules/no-prototype-builtins#disallow-use-of-objectprototypes-builtins-directly-no-prototype-builtins
- https://eslint.org/docs/rules/no-else-return#disallow-return-before-else-no-else-return
- Use
Object.entries()
to get key-value pairs in a loop - Use
Object.assign()
to merge default options (this could be a{...defaultOpts, ...nops}
but that is only supported from Node 8.3 (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#browser_compatibility)