Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
theodoreb committed Dec 29, 2016
1 parent d09438b commit 12fda12
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# eslint-config-drupal

Drupal ESlint configuration, taken directly from [.eslintrc](http://cgit.drupalcode.org/drupal/tree/.eslintrc?h=8.0.x).
Drupal ESlint configuration. To use it install the package and create
an `.eslintrc.json` file with the following:
```json
{
"extends": "eslint-config-drupal"
}
```

## References
* [Use ESLint to validate all Drupal JavaScript](https://www.drupal.org/node/2274223)
* [ESlint settings](https://www.drupal.org/node/1955232)
* [Drupal ESlint settings](https://www.drupal.org/node/1955232)
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = {
"extends": "eslint:recommended",
"env": {
"browser": true
"browser": true,
"es6": true,
"node": true
},
"globals": {
"Drupal": true,
Expand Down Expand Up @@ -30,13 +32,13 @@ module.exports = {
"guard-for-in": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"keyword-spacing": [2, {"before": true, "after": true}],
"linebreak-style": [2, "unix"],
"lines-around-comment": [2, {"beforeBlockComment": true, "afterBlockComment": false}],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-catch-shadow": 2,
"no-empty-label": 2,
"no-eval": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
Expand Down Expand Up @@ -71,17 +73,16 @@ module.exports = {
"object-curly-spacing": [2, "never"],
"one-var": [2, "never"],
"quote-props": [2, "consistent-as-needed"],
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"],
"semi-spacing": [2, {"before": false, "after": true}],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always"],
"strict": 2,
"strict": [2, "function"],
"yoda": [2, "never"],
// Warnings.
"max-nested-callbacks": [1, 3],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-drupal",
"version": "1.0.1",
"version": "2.0.0",
"description": "Drupal ESlint configuration",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 12fda12

Please sign in to comment.