| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ac6de2f commit 98f2224
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,11 +7,12 @@ | |||
| 7 | 7 | [](https://gitter.im/airbnb/javascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | |
| 8 | 8 | ||
| 9 | 9 | Other Style Guides | |
| 10 | - - [ES5 (Deprecated)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5) | ||
| 11 | - - [React](react/) | ||
| 12 | - - [CSS-in-JavaScript](css-in-javascript/) | ||
| 13 | - - [CSS & Sass](https://github.com/airbnb/css) | ||
| 14 | - - [Ruby](https://github.com/airbnb/ruby) | ||
| 10 | + | ||
| 11 | + - [ES5 (Deprecated)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5) | ||
| 12 | + - [React](react/) | ||
| 13 | + - [CSS-in-JavaScript](css-in-javascript/) | ||
| 14 | + - [CSS & Sass](https://github.com/airbnb/css) | ||
| 15 | + - [Ruby](https://github.com/airbnb/ruby) | ||
| 15 | 16 | ||
| 16 | 17 | ## Table of Contents | |
| 17 | 18 | ||
@@ -58,11 +59,11 @@ Other Style Guides | |||
| 58 | 59 | <a name="types--primitives"></a><a name="1.1"></a> | |
| 59 | 60 | - [1.1](#types--primitives) **Primitives**: When you access a primitive type you work directly on its value. | |
| 60 | 61 | ||
| 61 | - + `string` | ||
| 62 | - + `number` | ||
| 63 | - + `boolean` | ||
| 64 | - + `null` | ||
| 65 | - + `undefined` | ||
| 62 | + - `string` | ||
| 63 | + - `number` | ||
| 64 | + - `boolean` | ||
| 65 | + - `null` | ||
| 66 | + - `undefined` | ||
| 66 | 67 | ||
| 67 | 68 | ```javascript | |
| 68 | 69 | const foo = 1; | |
@@ -76,9 +77,9 @@ Other Style Guides | |||
| 76 | 77 | <a name="types--complex"></a><a name="1.2"></a> | |
| 77 | 78 | - [1.2](#types--complex) **Complex**: When you access a complex type you work on a reference to its value. | |
| 78 | 79 | ||
| 79 | - + `object` | ||
| 80 | - + `array` | ||
| 81 | - + `function` | ||
| 80 | + - `object` | ||
| 81 | + - `array` | ||
| 82 | + - `function` | ||
| 82 | 83 | ||
| 83 | 84 | ```javascript | |
| 84 | 85 | const foo = [1, 2]; | |
@@ -524,7 +525,6 @@ Other Style Guides | |||
| 524 | 525 | const { left, top } = processInput(input); | |
| 525 | 526 | ``` | |
| 526 | 527 | ||
| 527 | - | ||
| 528 | 528 | **[⬆ back to top](#table-of-contents)** | |
| 529 | 529 | ||
| 530 | 530 | ## Strings | |
@@ -610,7 +610,6 @@ Other Style Guides | |||
| 610 | 610 | ||
| 611 | 611 | **[⬆ back to top](#table-of-contents)** | |
| 612 | 612 | ||
| 613 | - | ||
| 614 | 613 | ## Functions | |
| 615 | 614 | ||
| 616 | 615 | <a name="functions--declarations"></a><a name="7.1"></a> | |
@@ -1016,7 +1015,6 @@ Other Style Guides | |||
| 1016 | 1015 | ||
| 1017 | 1016 | **[⬆ back to top](#table-of-contents)** | |
| 1018 | 1017 | ||
| 1019 | - | ||
| 1020 | 1018 | ## Classes & Constructors | |
| 1021 | 1019 | ||
| 1022 | 1020 | <a name="constructors--use-class"></a><a name="9.1"></a> | |
@@ -1035,7 +1033,6 @@ Other Style Guides | |||
| 1035 | 1033 | return value; | |
| 1036 | 1034 | }; | |
| 1037 | 1035 | ||
| 1038 | - | ||
| 1039 | 1036 | // good | |
| 1040 | 1037 | class Queue { | |
| 1041 | 1038 | constructor(contents = []) { | |
@@ -1110,7 +1107,6 @@ Other Style Guides | |||
| 1110 | 1107 | .setHeight(20); | |
| 1111 | 1108 | ``` | |
| 1112 | 1109 | ||
| 1113 | - | ||
| 1114 | 1110 | <a name="constructors--tostring"></a><a name="9.4"></a> | |
| 1115 | 1111 | - [9.4](#constructors--tostring) It's okay to write a custom toString() method, just make sure it works successfully and causes no side effects. | |
| 1116 | 1112 | ||
@@ -1182,10 +1178,8 @@ Other Style Guides | |||
| 1182 | 1178 | } | |
| 1183 | 1179 | ``` | |
| 1184 | 1180 | ||
| 1185 | - | ||
| 1186 | 1181 | **[⬆ back to top](#table-of-contents)** | |
| 1187 | 1182 | ||
| 1188 | - | ||
| 1189 | 1183 | ## Modules | |
| 1190 | 1184 | ||
| 1191 | 1185 | <a name="modules--use-them"></a><a name="10.1"></a> | |
@@ -1449,7 +1443,6 @@ Other Style Guides | |||
| 1449 | 1443 | ||
| 1450 | 1444 | **[⬆ back to top](#table-of-contents)** | |
| 1451 | 1445 | ||
| 1452 | - | ||
| 1453 | 1446 | ## Properties | |
| 1454 | 1447 | ||
| 1455 | 1448 | <a name="properties--dot"></a><a name="12.1"></a> | |
@@ -1486,7 +1479,6 @@ Other Style Guides | |||
| 1486 | 1479 | ||
| 1487 | 1480 | **[⬆ back to top](#table-of-contents)** | |
| 1488 | 1481 | ||
| 1489 | - | ||
| 1490 | 1482 | ## Variables | |
| 1491 | 1483 | ||
| 1492 | 1484 | <a name="variables--const"></a><a name="13.1"></a> | |
@@ -1656,7 +1648,6 @@ Other Style Guides | |||
| 1656 | 1648 | ||
| 1657 | 1649 | **[⬆ back to top](#table-of-contents)** | |
| 1658 | 1650 | ||
| 1659 | - | ||
| 1660 | 1651 | ## Hoisting | |
| 1661 | 1652 | ||
| 1662 | 1653 | <a name="hoisting--about"></a><a name="14.1"></a> | |
@@ -1756,7 +1747,6 @@ Other Style Guides | |||
| 1756 | 1747 | ||
| 1757 | 1748 | **[⬆ back to top](#table-of-contents)** | |
| 1758 | 1749 | ||
| 1759 | - | ||
| 1760 | 1750 | ## Comparison Operators & Equality | |
| 1761 | 1751 | ||
| 1762 | 1752 | <a name="comparison--eqeqeq"></a><a name="15.1"></a> | |
@@ -1765,12 +1755,12 @@ Other Style Guides | |||
| 1765 | 1755 | <a name="comparison--if"></a><a name="15.2"></a> | |
| 1766 | 1756 | - [15.2](#comparison--if) Conditional statements such as the `if` statement evaluate their expression using coercion with the `ToBoolean` abstract method and always follow these simple rules: | |
| 1767 | 1757 | ||
| 1768 | - + **Objects** evaluate to **true** | ||
| 1769 | - + **Undefined** evaluates to **false** | ||
| 1770 | - + **Null** evaluates to **false** | ||
| 1771 | - + **Booleans** evaluate to **the value of the boolean** | ||
| 1772 | - + **Numbers** evaluate to **false** if **+0, -0, or NaN**, otherwise **true** | ||
| 1773 | - + **Strings** evaluate to **false** if an empty string `''`, otherwise **true** | ||
| 1758 | + - **Objects** evaluate to **true** | ||
| 1759 | + - **Undefined** evaluates to **false** | ||
| 1760 | + - **Null** evaluates to **false** | ||
| 1761 | + - **Booleans** evaluate to **the value of the boolean** | ||
| 1762 | + - **Numbers** evaluate to **false** if **+0, -0, or NaN**, otherwise **true** | ||
| 1763 | + - **Strings** evaluate to **false** if an empty string `''`, otherwise **true** | ||
| 1774 | 1764 | ||
| 1775 | 1765 | ```javascript | |
| 1776 | 1766 | if ([0] && []) { | |
@@ -1910,7 +1900,6 @@ Other Style Guides | |||
| 1910 | 1900 | ||
| 1911 | 1901 | **[⬆ back to top](#table-of-contents)** | |
| 1912 | 1902 | ||
| 1913 | - | ||
| 1914 | 1903 | ## Blocks | |
| 1915 | 1904 | ||
| 1916 | 1905 | <a name="blocks--braces"></a><a name="16.1"></a> | |
@@ -1960,10 +1949,8 @@ Other Style Guides | |||
| 1960 | 1949 | } | |
| 1961 | 1950 | ``` | |
| 1962 | 1951 | ||
| 1963 | - | ||
| 1964 | 1952 | **[⬆ back to top](#table-of-contents)** | |
| 1965 | 1953 | ||
| 1966 | - | ||
| 1967 | 1954 | ## Control Statements | |
| 1968 | 1955 | ||
| 1969 | 1956 | <a name="control-statements"></a> | |
@@ -2018,10 +2005,8 @@ Other Style Guides | |||
| 2018 | 2005 | } | |
| 2019 | 2006 | ``` | |
| 2020 | 2007 | ||
| 2021 | - | ||
| 2022 | 2008 | **[⬆ back to top](#table-of-contents)** | |
| 2023 | 2009 | ||
| 2024 | - | ||
| 2025 | 2010 | ## Comments | |
| 2026 | 2011 | ||
| 2027 | 2012 | <a name="comments--multiline"></a><a name="17.1"></a> | |
@@ -2162,7 +2147,6 @@ Other Style Guides | |||
| 2162 | 2147 | ||
| 2163 | 2148 | **[⬆ back to top](#table-of-contents)** | |
| 2164 | 2149 | ||
| 2165 | - | ||
| 2166 | 2150 | ## Whitespace | |
| 2167 | 2151 | ||
| 2168 | 2152 | <a name="whitespace--spaces"></a><a name="18.1"></a> | |
@@ -2624,7 +2608,6 @@ Other Style Guides | |||
| 2624 | 2608 | ||
| 2625 | 2609 | **[⬆ back to top](#table-of-contents)** | |
| 2626 | 2610 | ||
| 2627 | - | ||
| 2628 | 2611 | ## Semicolons | |
| 2629 | 2612 | ||
| 2630 | 2613 | <a name="semicolons--required"></a><a name="20.1"></a> | |
@@ -2654,7 +2637,6 @@ Other Style Guides | |||
| 2654 | 2637 | ||
| 2655 | 2638 | **[⬆ back to top](#table-of-contents)** | |
| 2656 | 2639 | ||
| 2657 | - | ||
| 2658 | 2640 | ## Type Casting & Coercion | |
| 2659 | 2641 | ||
| 2660 | 2642 | <a name="coercion--explicit"></a><a name="21.1"></a> | |
@@ -2741,7 +2723,6 @@ Other Style Guides | |||
| 2741 | 2723 | ||
| 2742 | 2724 | **[⬆ back to top](#table-of-contents)** | |
| 2743 | 2725 | ||
| 2744 | - | ||
| 2745 | 2726 | ## Naming Conventions | |
| 2746 | 2727 | ||
| 2747 | 2728 | <a name="naming--descriptive"></a><a name="22.1"></a> | |
@@ -2933,7 +2914,6 @@ Other Style Guides | |||
| 2933 | 2914 | ||
| 2934 | 2915 | **[⬆ back to top](#table-of-contents)** | |
| 2935 | 2916 | ||
| 2936 | - | ||
| 2937 | 2917 | ## Accessors | |
| 2938 | 2918 | ||
| 2939 | 2919 | <a name="accessors--not-required"></a><a name="23.1"></a> | |
@@ -3003,7 +2983,6 @@ Other Style Guides | |||
| 3003 | 2983 | ||
| 3004 | 2984 | **[⬆ back to top](#table-of-contents)** | |
| 3005 | 2985 | ||
| 3006 | - | ||
| 3007 | 2986 | ## Events | |
| 3008 | 2987 | ||
| 3009 | 2988 | <a name="events--hash"></a><a name="24.1"></a> | |
@@ -3035,7 +3014,6 @@ Other Style Guides | |||
| 3035 | 3014 | ||
| 3036 | 3015 | **[⬆ back to top](#table-of-contents)** | |
| 3037 | 3016 | ||
| 3038 | - | ||
| 3039 | 3017 | ## jQuery | |
| 3040 | 3018 | ||
| 3041 | 3019 | <a name="jquery--dollar-prefix"></a><a name="25.1"></a> | |
@@ -3105,7 +3083,6 @@ Other Style Guides | |||
| 3105 | 3083 | ||
| 3106 | 3084 | **[⬆ back to top](#table-of-contents)** | |
| 3107 | 3085 | ||
| 3108 | - | ||
| 3109 | 3086 | ## ECMAScript 5 Compatibility | |
| 3110 | 3087 | ||
| 3111 | 3088 | <a name="es5-compat--kangax"></a><a name="26.1"></a> | |
@@ -3153,16 +3130,15 @@ Other Style Guides | |||
| 3153 | 3130 | ||
| 3154 | 3131 | <a name="testing--for-real"></a><a name="28.2"></a> | |
| 3155 | 3132 | - [29.2](#testing--for-real) **No, but seriously**: | |
| 3156 | - - Whichever testing framework you use, you should be writing tests! | ||
| 3157 | - - Strive to write many small pure functions, and minimize where mutations occur. | ||
| 3158 | - - Be cautious about stubs and mocks - they can make your tests more brittle. | ||
| 3159 | - - We primarily use [`mocha`](https://www.npmjs.com/package/mocha) at Airbnb. [`tape`](https://www.npmjs.com/package/tape) is also used occasionally for small, separate modules. | ||
| 3160 | - - 100% test coverage is a good goal to strive for, even if it's not always practical to reach it. | ||
| 3161 | - - Whenever you fix a bug, _write a regression test_. A bug fixed without a regression test is almost certainly going to break again in the future. | ||
| 3133 | + - Whichever testing framework you use, you should be writing tests! | ||
| 3134 | + - Strive to write many small pure functions, and minimize where mutations occur. | ||
| 3135 | + - Be cautious about stubs and mocks - they can make your tests more brittle. | ||
| 3136 | + - We primarily use [`mocha`](https://www.npmjs.com/package/mocha) at Airbnb. [`tape`](https://www.npmjs.com/package/tape) is also used occasionally for small, separate modules. | ||
| 3137 | + - 100% test coverage is a good goal to strive for, even if it's not always practical to reach it. | ||
| 3138 | + - Whenever you fix a bug, _write a regression test_. A bug fixed without a regression test is almost certainly going to break again in the future. | ||
| 3162 | 3139 | ||
| 3163 | 3140 | **[⬆ back to top](#table-of-contents)** | |
| 3164 | 3141 | ||
| 3165 | - | ||
| 3166 | 3142 | ## Performance | |
| 3167 | 3143 | ||
| 3168 | 3144 | - [On Layout & Web Performance](https://www.kellegous.com/j/2013/01/26/layout-performance/) | |
@@ -3177,7 +3153,6 @@ Other Style Guides | |||
| 3177 | 3153 | ||
| 3178 | 3154 | **[⬆ back to top](#table-of-contents)** | |
| 3179 | 3155 | ||
| 3180 | - | ||
| 3181 | 3156 | ## Resources | |
| 3182 | 3157 | ||
| 3183 | 3158 | **Learning ES6** | |
@@ -3194,9 +3169,9 @@ Other Style Guides | |||
| 3194 | 3169 | **Tools** | |
| 3195 | 3170 | ||
| 3196 | 3171 | - Code Style Linters | |
| 3197 | - + [ESlint](http://eslint.org/) - [Airbnb Style .eslintrc](https://github.com/airbnb/javascript/blob/master/linters/.eslintrc) | ||
| 3198 | - + [JSHint](http://jshint.com/) - [Airbnb Style .jshintrc](https://github.com/airbnb/javascript/blob/master/linters/.jshintrc) | ||
| 3199 | - + [JSCS](https://github.com/jscs-dev/node-jscs) - [Airbnb Style Preset](https://github.com/jscs-dev/node-jscs/blob/master/presets/airbnb.json) (Deprecated, please use [ESlint](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base)) | ||
| 3172 | + - [ESlint](http://eslint.org/) - [Airbnb Style .eslintrc](https://github.com/airbnb/javascript/blob/master/linters/.eslintrc) | ||
| 3173 | + - [JSHint](http://jshint.com/) - [Airbnb Style .jshintrc](https://github.com/airbnb/javascript/blob/master/linters/.jshintrc) | ||
| 3174 | + - [JSCS](https://github.com/jscs-dev/node-jscs) - [Airbnb Style Preset](https://github.com/jscs-dev/node-jscs/blob/master/presets/airbnb.json) (Deprecated, please use [ESlint](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base)) | ||
| 3200 | 3175 | - Neutrino preset - [neutrino-preset-airbnb-base](https://neutrino.js.org/presets/neutrino-preset-airbnb-base/) | |
| 3201 | 3176 | ||
| 3202 | 3177 | **Other Style Guides** | |
@@ -3257,7 +3232,6 @@ Other Style Guides | |||
| 3257 | 3232 | - [JavaScript Air](https://javascriptair.com/) | |
| 3258 | 3233 | - [JavaScript Jabber](https://devchat.tv/js-jabber/) | |
| 3259 | 3234 | ||
| 3260 | - | ||
| 3261 | 3235 | **[⬆ back to top](#table-of-contents)** | |
| 3262 | 3236 | ||
| 3263 | 3237 | ## In the Wild | |
@@ -3385,7 +3359,6 @@ Other Style Guides | |||
| 3385 | 3359 | ||
| 3386 | 3360 | - [View Contributors](https://github.com/airbnb/javascript/graphs/contributors) | |
| 3387 | 3361 | ||
| 3388 | - | ||
| 3389 | 3362 | ## License | |
| 3390 | 3363 | ||
| 3391 | 3364 | (The MIT License) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,7 +176,6 @@ | |||
| 176 | 176 | ||
| 177 | 177 | export default withStyles(() => styles)(MyComponent); | |
| 178 | 178 | ||
| 179 | - | ||
| 180 | 179 | // good | |
| 181 | 180 | function MyComponent({ styles }) { | |
| 182 | 181 | return ( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments