From 4d009b68ffb54fb331ad28ac5adf9b8f5ee9392e Mon Sep 17 00:00:00 2001 From: Andrei Neculau Date: Tue, 14 May 2019 10:15:06 +0200 Subject: [PATCH] add @getify/eslint-plugin-proper-arrows --- browser.js | 1 + configs/proper-arrows.js | 29 +++++++++++++++++++++++++++++ node.js | 1 + package.json | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 configs/proper-arrows.js diff --git a/browser.js b/browser.js index ba1f73e..1a1e2cc 100644 --- a/browser.js +++ b/browser.js @@ -9,6 +9,7 @@ module.exports = { './configs/import.js', './configs/lodash.js', './configs/no-null.js', + './configs/proper-arrows.js', './configs/browser.js' ] diff --git a/configs/proper-arrows.js b/configs/proper-arrows.js new file mode 100644 index 0000000..ab385c7 --- /dev/null +++ b/configs/proper-arrows.js @@ -0,0 +1,29 @@ +module.exports = { + plugins: [ + '@getify/proper-arrows' + ], + + rules: { + // OFF because AsyncFunctionExpressions are handled by max-params, no-unused-vars + '@getify/proper-arrows/params': 'off', + // OFF because it doesn't support 'never' + '@getify/proper-arrows/names': 'off', + '@getify/proper-arrows/where': ['error', { + global: true, + property: true, + export: true, + trivial: true + }], + '@getify/proper-arrows/return': ['error', { + object: true, + ternatry: true, + chained: true, + sequence: true, + trivial: true + }], + '@getify/proper-arrows/this': ['error', 'nested', { + 'no-global': true, + trivial: true + }] + } +}; diff --git a/node.js b/node.js index 616136c..36485bf 100644 --- a/node.js +++ b/node.js @@ -9,6 +9,7 @@ module.exports = { './configs/import.js', './configs/lodash.js', './configs/no-null.js', + './configs/proper-arrows.js', './configs/node.js' ] diff --git a/package.json b/package.json index fa7c933..b7db065 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "/rules/" ], "peerDependencies": { + "@getify/eslint-plugin-proper-arrows": "^8.0.1", "babel-eslint": "^10.0.1", "eslint": "^5.9.0", "eslint-plugin-async-await": "^0.0.0", @@ -29,6 +30,7 @@ "lodash": "^4.17.5" }, "devDependencies": { + "@getify/eslint-plugin-proper-arrows": "^8.0.1", "babel-eslint": "^10.0.1", "eclint": "^2.6.0", "eslint": "^5.9.0",