Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Add style for computed property names (#69)
Browse files Browse the repository at this point in the history
* Describe style for computed property names. This style is checked using [computed-property-spacing](http://eslint.org/docs/rules/computed-property-spacing)
  eslint rule.
* Add [no-useless-computed-key](http://eslint.org/docs/rules/no-useless-computed-key)
  eslint rule to `es6` config.
  • Loading branch information
ikokostya committed Sep 19, 2016
1 parent f39e86a commit ecc7733
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ while (items.length) {
};
```

* Spaces inside computed property brackets should not be used:

**Good:**

```js
var value = obj[key];
```

**Bad:**

```js
var value = obj[ key ];
```

[↑ back to TOC](#table-of-contents)

### Arrays
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-loris/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
'no-const-assign': 2,
'no-dupe-class-members': 2,
'no-this-before-super': 2,
'no-useless-computed-key': 2,
'no-var': 2,
'prefer-arrow-callback': 2,
'prefer-const': 2,
Expand Down

0 comments on commit ecc7733

Please sign in to comment.