From 13e17fe089f1a80b836bf6019f547384e80c197a Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:14:05 +0200 Subject: [PATCH] Move ESLint config outside of the eslint-plugin package --- .eslintrc.js | 10 ++++++++++ packages/eslint-plugin/configs/react.js | 11 +---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 4fd16d23830e92..d0c22090b93e87 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -156,6 +156,7 @@ module.exports = { 'plugin:eslint-comments/recommended', 'plugin:storybook/recommended', ], + plugins: [ 'react-compiler' ], globals: { wp: 'off', globalThis: 'readonly', @@ -222,6 +223,15 @@ module.exports = { definedTags: [ 'jest-environment' ], }, ], + 'react-compiler/react-compiler': [ + 'error', + { + environment: { + enableTreatRefLikeIdentifiersAsRefs: true, + validateRefAccessDuringRender: false, + }, + }, + ], }, overrides: [ { diff --git a/packages/eslint-plugin/configs/react.js b/packages/eslint-plugin/configs/react.js index 4a10d882a7ec73..04e4341c720be2 100644 --- a/packages/eslint-plugin/configs/react.js +++ b/packages/eslint-plugin/configs/react.js @@ -10,7 +10,7 @@ module.exports = { version: 'detect', }, }, - plugins: [ '@wordpress', 'react-compiler', 'react', 'react-hooks' ], + plugins: [ '@wordpress', 'react', 'react-hooks' ], rules: { '@wordpress/no-unused-vars-before-return': [ 'error', @@ -34,15 +34,6 @@ module.exports = { 'react/no-children-prop': 'off', 'react/prop-types': 'off', 'react/react-in-jsx-scope': 'off', - 'react-compiler/react-compiler': [ - 'error', - { - environment: { - enableTreatRefLikeIdentifiersAsRefs: true, - validateRefAccessDuringRender: false, - }, - }, - ], 'react-hooks/exhaustive-deps': [ 'warn', {