Skip to content

Commit

Permalink
[eslint-plugin-react-hooks] Inline meta fields
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.
  • Loading branch information
poteto committed Jan 17, 2025
1 parent b25bcd4 commit 7d01464
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
Expand Up @@ -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,
Expand All @@ -32,7 +30,7 @@ const legacyRecommendedConfig = {

// Base plugin object
const reactHooksPlugin = {
meta: {name, version},
meta: {name: 'eslint-plugin-react-hooks'},
rules,
};

Expand Down

0 comments on commit 7d01464

Please sign in to comment.