@samitouri / QOS-React / commits / fd2d279984

[eslint-plugin-react-hooks] Inline meta fields (#32115)

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.

lauren committed Jan 17, 2025 at 15:16 UTC fd2d2799840d9066a752bb32bbbb07c93f64a891
1 file changed +1 -3
packages/eslint-plugin-react-hooks/src/index.js
+1 -3
@@ -10,8 +10,6 @@
10 import RulesOfHooks from './RulesOfHooks';
11 import ExhaustiveDeps from './ExhaustiveDeps';
12
13 -const {name, version} = require('../package.json');
14 -
13 // All rules
14 export const rules = {
15 'rules-of-hooks': RulesOfHooks,
@@ -32,7 +30,7 @@ const legacyRecommendedConfig = {
30
31 // Base plugin object
32 const reactHooksPlugin = {
35 - meta: {name, version},
33 + meta: {name: 'eslint-plugin-react-hooks'},
34 rules,
35 };
36