From 7d01464d3c19574333221dc2ced00373435b690e Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 17 Jan 2025 15:06:32 -0500 Subject: [PATCH] [eslint-plugin-react-hooks] Inline meta fields rollup doesn't inline cjs requires (although it can with an external plugin), so requiring package.json was causing issues internally at Meta since that file doesn't exist there. We could teach our build scripts to do so but given that the eslint meta field is optional anyways I opted to just hardcode the name and omit the version. --- packages/eslint-plugin-react-hooks/src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/eslint-plugin-react-hooks/src/index.js b/packages/eslint-plugin-react-hooks/src/index.js index c9da639a4fff6..0ebfbc91a5a8d 100644 --- a/packages/eslint-plugin-react-hooks/src/index.js +++ b/packages/eslint-plugin-react-hooks/src/index.js @@ -10,8 +10,6 @@ import RulesOfHooks from './RulesOfHooks'; import ExhaustiveDeps from './ExhaustiveDeps'; -const {name, version} = require('../package.json'); - // All rules export const rules = { 'rules-of-hooks': RulesOfHooks, @@ -32,7 +30,7 @@ const legacyRecommendedConfig = { // Base plugin object const reactHooksPlugin = { - meta: {name, version}, + meta: {name: 'eslint-plugin-react-hooks'}, rules, };