From 8cff7b9cd6a0c7b98f66cf34b2b062925badfc61 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 7 May 2021 21:00:39 +0100 Subject: [PATCH] Added length rule for index files [warn] - index.js files are meant to be an index, not contain behaviour or logic - files longer than 50 lines are indicative of code in the wrong place, all though not definitive - enabling this as a hint to get us to move code to better locations --- .eslintrc.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 250a30a65e..a7e2aa0d47 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,6 +16,12 @@ module.exports = { 'one-var': [2, 'never'] }, overrides: [ + { + files: '**/index.js', + rules: { + 'max-lines': ['warn', {skipBlankLines: true, skipComments: true, max: 50}] + } + }, { files: 'core/server/api/canary/*', rules: {