Skip to content

Commit

Permalink
[eslint-plugin-react-hooks] Inline meta fields (#32115)
Browse files Browse the repository at this point in the history
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.
poteto authored Jan 17, 2025
1 parent b25bcd4 commit fd2d279
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/eslint-plugin-react-hooks/src/index.js
Original file line number Diff line number Diff line change
@@ -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,
};

0 comments on commit fd2d279

Please sign in to comment.