From 581c75757da9457d983cd1403a1f3b6984bef78f Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Mon, 2 Oct 2023 16:45:49 -0400 Subject: [PATCH] [core] Update eslint rules (#39178) --- .eslintrc.js | 11 +++++++++++ docs/src/modules/components/AppNavDrawer.js | 8 +------- .../src/getPropTypesFromFile.ts | 1 - 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a8068eb733e4d8..48f261573e5a3b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -74,6 +74,7 @@ module.exports = { ], }, ], + 'no-continue': 'off', 'no-constant-condition': 'error', // Use the proptype inheritance chain 'no-prototype-builtins': 'off', @@ -83,6 +84,16 @@ module.exports = { // Destructuring harm grep potential. 'prefer-destructuring': 'off', + '@typescript-eslint/no-use-before-define': [ + 'error', + { + functions: false, + classes: true, + variables: true, + }, + ], + 'no-use-before-define': 'off', + // disabled type-aware linting due to performance considerations '@typescript-eslint/dot-notation': 'off', 'dot-notation': 'error', diff --git a/docs/src/modules/components/AppNavDrawer.js b/docs/src/modules/components/AppNavDrawer.js index f6293d896c864a..8bd4fa005a3b1b 100644 --- a/docs/src/modules/components/AppNavDrawer.js +++ b/docs/src/modules/components/AppNavDrawer.js @@ -211,13 +211,7 @@ function renderNavItems(options) { const { pages, ...params } = options; return ( - - {pages.reduce( - // eslint-disable-next-line @typescript-eslint/no-use-before-define - (items, page) => reduceChildRoutes({ items, page, ...params }), - [], - )} - + {pages.reduce((items, page) => reduceChildRoutes({ items, page, ...params }), [])} ); } diff --git a/packages/typescript-to-proptypes/src/getPropTypesFromFile.ts b/packages/typescript-to-proptypes/src/getPropTypesFromFile.ts index 0da13bc41aaac8..a0c3e3d0393788 100644 --- a/packages/typescript-to-proptypes/src/getPropTypesFromFile.ts +++ b/packages/typescript-to-proptypes/src/getPropTypesFromFile.ts @@ -228,7 +228,6 @@ function checkType({ return createInterfaceType({ jsDoc, types: filtered.map((x) => { - // eslint-disable-next-line @typescript-eslint/no-use-before-define -- TODO dependency cycle between checkSymbol and checkType const definition = checkSymbol({ symbol: x, location,