javascript
javascript copied to clipboard
JavaScript Style Guide
@ljharb @erights Can you guys let me know if this correct? Thanks! Fixes #1673.
`WrappedComponent` static property should be added to custom High-Order component to get access to the initial(decorated component). In most cases it would allow to avoid issue [`import/no-named-as-default`](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md)
Any project that currently uses eslint-config-airbnb checked out on Windows results in thousands of linter errors since the line endings will be CRLF, making it impossible to contribute to these...
You mention NaN evaluates to false but don't explicitly mention that any comparison to NaN evalutes to false, including NaN === NaN. Added a note about this at the bottom...
Related to #990 I removed the comment "No! We shouldn't mutate function arguments.", because it doesn't add any new information and added a "Why?" quote.
Defaulting omitted variables using `||` is like using `==` instead of `===`. If a function's argument is falsy (`0`, `false`, `null`, `''`...), it will be defaulted while it shouldn't be....
E.g. ``` javascript function call(url, timeout = 60) { return request.call(url, {timeout}); } ``` I think that really makes sense. Moreover, that's a JavaScript way - "everything is exposed, except...
Add section about Short Circuit Evaluation
In the process of forking your amazing style guide and porting across some of the differences in our old internal style guide, we found some additional notes on naming conventions...