From 557433ce26e6f9035d7f787513e33559903214c0 Mon Sep 17 00:00:00 2001 From: Steven Sacks Date: Tue, 12 May 2020 05:18:17 +0900 Subject: [PATCH 1/2] feat(eslint): disable function scoping --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index f3accc6..ea9e077 100644 --- a/index.js +++ b/index.js @@ -105,6 +105,10 @@ module.exports = { // regular expressions. 'unicorn/no-unsafe-regex': 'error', + // This is a common pattern in React, and has been proven to be a premature optimization + // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/consistent-function-scoping.md + 'unicorn/consistent-function-scoping': 'off', + // Functions that take many positional arguments can be difficult to work // with and produce less maintainable APIs. When more than three arguments // are needed, named arguments should be used. From 27eef1d64fb2902b7a6717dbda486c58a7dd35b2 Mon Sep 17 00:00:00 2001 From: Jonny Adshead Date: Wed, 1 Jul 2020 08:36:04 -0700 Subject: [PATCH 2/2] feat(consistent-function-scoping): warn only --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index e4bc4b6..c3618ee 100644 --- a/index.js +++ b/index.js @@ -116,9 +116,8 @@ module.exports = { // regular expressions. 'unicorn/no-unsafe-regex': 'error', - // This is a common pattern in React, and has been proven to be a premature optimization // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/consistent-function-scoping.md - 'unicorn/consistent-function-scoping': 'off', + 'unicorn/consistent-function-scoping': 'warn', // Preventing abbreviations is incompatible with React standards (props, ref, etc.) // Additionally, there are many popular libraries that have abbreviations