Skip to content

Commit bfc842e

Browse files
committed
Remove rules about reserved words
In 53b4173 we removed the ES5 guide which contains a lot of guidelines that are no longer very relevant for us. Similarly, some folks have raised the relevance of these rules about reserved words, given that we are now living in an age where ES3 support has mostly waned and transpilers such as Babel are widely adopted and pave over these issues. This seems like a good opportunity to simplify. Fixes #61
1 parent f0b3196 commit bfc842e

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

README.md

-37
Original file line numberDiff line numberDiff line change
@@ -153,43 +153,6 @@ Other Style Guides
153153
const item = {};
154154
```
155155
156-
<a name="objects--reserved-words"></a><a name="3.2"></a>
157-
- [3.2](#objects--reserved-words) If your code will be executed in browsers in script context, don't use [reserved words](http://es5.github.io/#x7.6.1) as keys. It won't work in IE8. [More info](https://github.com/airbnb/javascript/issues/61). It’s OK to use them in ES6 modules and server-side code. jscs: [`disallowIdentifierNames`](http://jscs.info/rule/disallowIdentifierNames)
158-
159-
```javascript
160-
// bad
161-
var superman = {
162-
default: { clark: 'kent' },
163-
private: true,
164-
};
165-
166-
// good
167-
var superman = {
168-
defaults: { clark: 'kent' },
169-
hidden: true,
170-
};
171-
```
172-
173-
<a name="objects--reserved-words-2"></a><a name="3.3"></a>
174-
- [3.3](#objects--reserved-words-2) Use readable synonyms in place of reserved words. jscs: [`disallowIdentifierNames`](http://jscs.info/rule/disallowIdentifierNames)
175-
176-
```javascript
177-
// bad
178-
var superman = {
179-
class: 'alien',
180-
};
181-
182-
// bad
183-
var superman = {
184-
klass: 'alien',
185-
};
186-
187-
// good
188-
var superman = {
189-
type: 'alien',
190-
};
191-
```
192-
193156
<a name="es6-computed-properties"></a><a name="3.4"></a>
194157
- [3.4](#es6-computed-properties) Use computed property names when creating objects with dynamic property names.
195158

0 commit comments

Comments
 (0)