Skip to content
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

Remove rules about reserved words #991

Merged
merged 1 commit into from
Aug 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,43 +153,6 @@ Other Style Guides
const item = {};
```

<a name="objects--reserved-words"></a><a name="3.2"></a>
- [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)

```javascript
// bad
var superman = {
default: { clark: 'kent' },
private: true,
};

// good
var superman = {
defaults: { clark: 'kent' },
hidden: true,
};
```

<a name="objects--reserved-words-2"></a><a name="3.3"></a>
- [3.3](#objects--reserved-words-2) Use readable synonyms in place of reserved words. jscs: [`disallowIdentifierNames`](http://jscs.info/rule/disallowIdentifierNames)

```javascript
// bad
var superman = {
class: 'alien',
};

// bad
var superman = {
klass: 'alien',
};

// good
var superman = {
type: 'alien',
};
```

<a name="es6-computed-properties"></a><a name="3.4"></a>
- [3.4](#es6-computed-properties) Use computed property names when creating objects with dynamic property names.

Expand Down