Skip to content

Commit

Permalink
78 es6 config (#16)
Browse files Browse the repository at this point in the history
* Add new es6 common config enforcing no-var

* Add to index.js

* Fix import?

* Fix import? 2

* Add no-confusing-arrow and strict (global)

* Add arrow-parens. Also comments and organization.

* Revert change to old yml. Add no-const-assign to ES6.

* rename key from ugly commonEs6 common-es6

* Improve comment
  • Loading branch information
qmaurmann authored Jul 7, 2016
1 parent 322baca commit a78229c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ extends:
"plugin:bodylabs/common"
```
Or for ES6:
```yml
extends:
"plugin:bodylabs/common-es6"
```
And then set up scripts:
```json
Expand Down
17 changes: 17 additions & 0 deletions eslint/common-es6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends:
"./eslint/common.yml"

rules:
strict: ["error", "global"]

no-var: "error"
no-const-assign: "error"

# No parens single-arg arrow functions:
# a => a; // instead of (a) => a
# Other cases are still good:
# () => {};
# (a, b, c) => a;
arrow-parens: ["error", "as-needed"]
# Don't write `a => 1 ? 2 : 3` (could be confused with `a <= 1 ? 2 : 3;`)
no-confusing-arrow: "error"
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ const loadConfig = (name) => {
module.exports = {
configs: {
common: loadConfig('common'),
'common-es6': loadConfig('common-es6'),
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-bodylabs",
"version": "7.0.0",
"version": "7.1.0",
"description": "Body Labs JavaScript style",
"repository": {
"type": "git",
Expand Down

0 comments on commit a78229c

Please sign in to comment.