Skip to content

Commit

Permalink
feat: Prefer one-line arrow function
Browse files Browse the repository at this point in the history
See also #22

BREAKING CHANGE: This adds a new rule and might break existing tests
  • Loading branch information
jhnns committed Aug 26, 2018
1 parent 4c4f531 commit ade2f16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 11 additions & 1 deletion base.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = {
"array-func",
"promise",
"babel",
"no-unsafe-regex"
"no-unsafe-regex",
"prefer-arrow"
],
extends: [
"eslint:recommended",
Expand Down Expand Up @@ -586,6 +587,15 @@ module.exports = {
},
], // http://eslint.org/docs/rules/padding-line-between-statements
"prefer-arrow-callback": "error", // http://eslint.org/docs/rules/prefer-arrow-callback
// https://github.com/TristonJ/eslint-plugin-prefer-arrow
"prefer-arrow/prefer-arrow-functions": [
"error",
{
classPropertiesAllowed: true,
disallowPrototype: false,
singleReturnOnly: true
}
],
"prefer-const": "error", // http://eslint.org/docs/rules/prefer-const
"prefer-destructuring": "off", // http://eslint.org/docs/rules/prefer-destructuring
"prefer-numeric-literals": "error", // http://eslint.org/docs/rules/prefer-numeric-literals
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"eslint-plugin-jsdoc": "^3.8.0",
"eslint-plugin-no-unsafe-regex": "^1.0.0",
"eslint-plugin-optimize-regex": "^1.1.5",
"eslint-plugin-prefer-arrow": "^1.1.2",
"eslint-plugin-promise": "^4.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit ade2f16

Please sign in to comment.