Skip to content

Commit 66d4ba4

Browse files
author
Stella Cannefax
authored
remove no-var description & comma-dangle
1 parent eea5f0f commit 66d4ba4

File tree

1 file changed

+1
-74
lines changed

1 file changed

+1
-74
lines changed

README.md

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
# Airbnb JavaScript Style Guide() {
1+
# Unity JavaScript Style Guide() {
22

33
*A mostly reasonable approach to JavaScript*
44

5-
[![Downloads](https://img.shields.io/npm/dm/eslint-config-airbnb.svg)](https://www.npmjs.com/package/eslint-config-airbnb)
6-
[![Downloads](https://img.shields.io/npm/dm/eslint-config-airbnb-base.svg)](https://www.npmjs.com/package/eslint-config-airbnb-base)
7-
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/airbnb/javascript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
8-
95
Other Style Guides
106
- [ES5](es5/)
11-
- [React](react/)
12-
- [CSS & Sass](https://github.com/airbnb/css)
13-
- [Ruby](https://github.com/airbnb/ruby)
147

158
## Table of Contents
169

@@ -106,25 +99,6 @@ Other Style Guides
10699
const b = 2;
107100
```
108101
109-
<a name="references--disallow-var"></a><a name="2.2"></a>
110-
- [2.2](#references--disallow-var) If you must reassign references, use `let` instead of `var`. eslint: [`no-var`](http://eslint.org/docs/rules/no-var.html) jscs: [`disallowVar`](http://jscs.info/rule/disallowVar)
111-
112-
> Why? `let` is block-scoped rather than function-scoped like `var`.
113-
114-
```javascript
115-
// bad
116-
var count = 1;
117-
if (true) {
118-
count += 1;
119-
}
120-
121-
// good, use the let.
122-
let count = 1;
123-
if (true) {
124-
count += 1;
125-
}
126-
```
127-
128102
<a name="references--block-scope"></a><a name="2.3"></a>
129103
- [2.3](#references--block-scope) Note that both `let` and `const` are block-scoped.
130104
@@ -2195,53 +2169,6 @@ Other Style Guides
21952169
};
21962170
```
21972171

2198-
<a name="commas--dangling"></a><a name="19.2"></a>
2199-
- [19.2](#commas--dangling) Additional trailing comma: **Yup.** eslint: [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle.html) jscs: [`requireTrailingComma`](http://jscs.info/rule/requireTrailingComma)
2200-
2201-
> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you don't have to worry about the [trailing comma problem](es5/README.md#commas) in legacy browsers.
2202-
2203-
```javascript
2204-
// bad - git diff without trailing comma
2205-
const hero = {
2206-
firstName: 'Florence',
2207-
- lastName: 'Nightingale'
2208-
+ lastName: 'Nightingale',
2209-
+ inventorOf: ['coxcomb chart', 'modern nursing']
2210-
};
2211-
2212-
// good - git diff with trailing comma
2213-
const hero = {
2214-
firstName: 'Florence',
2215-
lastName: 'Nightingale',
2216-
+ inventorOf: ['coxcomb chart', 'modern nursing'],
2217-
};
2218-
2219-
// bad
2220-
const hero = {
2221-
firstName: 'Dana',
2222-
lastName: 'Scully'
2223-
};
2224-
2225-
const heroes = [
2226-
'Batman',
2227-
'Superman'
2228-
];
2229-
2230-
// good
2231-
const hero = {
2232-
firstName: 'Dana',
2233-
lastName: 'Scully',
2234-
};
2235-
2236-
const heroes = [
2237-
'Batman',
2238-
'Superman',
2239-
];
2240-
```
2241-
2242-
**[⬆ back to top](#table-of-contents)**
2243-
2244-
22452172
## Semicolons
22462173

22472174
<a name="semicolons--required"></a><a name="20.1"></a>

0 commit comments

Comments
 (0)