forked from airbnb/javascript
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating to recent style guide version from upstream airbnb repo #2
Open
ahtee
wants to merge
318
commits into
GeneralElectric:master
Choose a base branch
from
ahtee:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… assignment expression ```js let param = 'default value'; if (object) param = object.param; // <= prefer-destructuring } // ... ``` I think that `param = object.param;` is better than `({ param } = object);` because it is easier to read and tedious to write brackets by hand. MDN: [Destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
For convenience, added brief explanations that are given in the linked discussion (mostly eliminating the need to scroll through the comments).
As "foo" is still meaningless, but with "short", we can see that, we are intend to use a short alias name to make our coding happily.
It came from the special characters "M-BM-": ``` diff README.md README.md.new | cat -A 651c651$ < const foo = function uniqueMoreDescriptiveLexicalFoo() {$ ---$ > M-BM- M-BM- const short = function longUniqueMoreDescriptiveLexicalFoo() {$ ```
…`**` and `%` mixed with arithmetic operators; removes violation against mixing common math operators. Fixes airbnb#1071.
- also remove legacy numbered link
- Also add note that symbols cannot by polyfilled and should not be used in environments that don't support them
Remove unnecessary variables
…sition` rule and adds link to guide
[guide] [react] Added anti-pattern example for Props Naming rule, changed className props in examples
The result of a `s_http://eslint\.org_https://eslint\.org_g`. Avoids the HTTP 302s of the non-HTTPs URLs.
…’t break old node; pin included builds to LTS.
…necessary for server-rendering. Fixes airbnb#684.
Also update code samples to highlight ways in which ES6 currently mishandles code when relying on Automatic Semicolon Insertion Revise hyperlink and example - Use more up-to-date TC39 reference page on github.io - wrap returnless function with side-effects in curly braces also, clean up punctuation on a long comment line Always use single-quoted strings Except for when the string needs to be double-quoted because the string contains apostrophes Update second example to incorporate IIFE An IIFE is a more realistic example of code that developers may encounter which would raise an exception when relying completely upon ASI
…alid' a11y rule Support React Router's `<Link to="...">` attribute out of the box.
(preserve old link for back-compat)
…derPropertyDescriptor` option
…as-associated-label`
It took me too long to realize that `"extends": "airbnb/hooks"` won't cut it, and that you need to include both `"extends": ["airbnb", "airbnb/hooks"]`. I think the docs should be explicit about this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also added Vue style guide for those using vue.