Skip to content

Commit

Permalink
Update with latest rules from core
Browse files Browse the repository at this point in the history
  • Loading branch information
theodoreb committed Oct 15, 2020
1 parent f9485c9 commit efc99f0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# eslint-config-drupal

Drupal ESlint configuration. To use it install the package and create
an `.eslintrc.json` file with the following:
Drupal ESlint configuration. To use it create a`.eslintrc.json` file with the following content:
```json
{
"extends": [
"eslint-config-airbnb",
"eslint-config-drupal"
"drupal"
]
}
```
Expand Down
36 changes: 23 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
"extends": "eslint-config-airbnb",
"extends": [
"airbnb",
"plugin:prettier/recommended"
],
"env": {
"browser": true,
"es6": true,
Expand All @@ -9,33 +12,40 @@ module.exports = {
"Drupal": true,
"drupalSettings": true,
"drupalTranslations": true,
"domready": true,
"jQuery": true,
"_": true,
"matchMedia": true,
"Cookies": true,
"Backbone": true,
"Modernizr": true,
"Popper": true,
"Sortable": true,
"CKEDITOR": true
},
"settings": {
"react": {
"version": "latest"
}
},
"rules": {
"consistent-return": [0],
"no-underscore-dangle": [0],
"max-nested-callbacks": [1, 3],
"import/no-mutable-exports": [1],
"no-plusplus": [1, {
"prettier/prettier": "error",
"consistent-return": ["off"],
"no-underscore-dangle": ["off"],
"max-nested-callbacks": ["warn", 3],
"import/no-mutable-exports": ["warn"],
"no-plusplus": ["warn", {
"allowForLoopAfterthoughts": true
}],
"no-param-reassign": [0],
"no-prototype-builtins": [0],
"valid-jsdoc": [1, {
"no-param-reassign": ["off"],
"no-prototype-builtins": ["off"],
"valid-jsdoc": ["warn", {
"prefer": {
"returns": "return",
"property": "prop"
},
"requireReturn": false
}],
"brace-style": ["error", "stroustrup"],
"no-unused-vars": [1]
"no-unused-vars": ["warn"],
"operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }]
}
};

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-drupal",
"version": "4.0.1",
"version": "5.0.1",
"description": "Drupal ESlint configuration",
"main": "index.js",
"repository": {
Expand All @@ -18,7 +18,15 @@
"url": "https://github.com/theodoreb/eslint-config-drupal/issues"
},
"homepage": "https://github.com/theodoreb/eslint-config-drupal#readme",
"peerDependencies": {
"eslint": ">= 3"
"dependencies": {
"eslint": "^6.7.2",
"prettier": "^1.14.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-react-hooks": "^1.7.0"
}
}

0 comments on commit efc99f0

Please sign in to comment.