From 17670e8e3876ffc080b6635c63a35746f5fafd86 Mon Sep 17 00:00:00 2001 From: liyujun <90846188+liyujun-dev@users.noreply.github.com> Date: Mon, 25 Apr 2022 01:02:25 +0800 Subject: [PATCH] fix: space-before-function-paren allows space in anonymous and asyncArrow function. (#84) --- packages/basic/index.js | 9 ++++++++- packages/basic/standard.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/basic/index.js b/packages/basic/index.js index 0c5ab5b..3c0b516 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -183,7 +183,14 @@ module.exports = { ], 'object-curly-spacing': ['error', 'always'], 'no-return-await': 'off', - 'space-before-function-paren': ['error', 'never'], + 'space-before-function-paren': [ + 'error', + { + 'anonymous': 'always', + 'named': 'never', + 'asyncArrow': 'always' + } + ], 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 1 }], // es6 diff --git a/packages/basic/standard.js b/packages/basic/standard.js index 681ff9d..e26325b 100644 --- a/packages/basic/standard.js +++ b/packages/basic/standard.js @@ -202,7 +202,14 @@ module.exports = { 'semi': ['error', 'never'], 'semi-spacing': ['error', { before: false, after: true }], 'space-before-blocks': ['error', 'always'], - 'space-before-function-paren': ['error', 'always'], + 'space-before-function-paren': [ + 'error', + { + 'anonymous': 'always', + 'named': 'never', + 'asyncArrow': 'always' + } + ], 'space-in-parens': ['error', 'never'], 'space-infix-ops': 'error', 'space-unary-ops': ['error', { words: true, nonwords: false }],