Skip to content

Commit fd2d279

Browse files
authored
[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.
1 parent b25bcd4 commit fd2d279

File tree

1 file changed

+1
-3
lines changed
  • packages/eslint-plugin-react-hooks/src

1 file changed

+1
-3
lines changed

packages/eslint-plugin-react-hooks/src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import RulesOfHooks from './RulesOfHooks';
1111
import ExhaustiveDeps from './ExhaustiveDeps';
1212

13-
const {name, version} = require('../package.json');
14-
1513
// All rules
1614
export const rules = {
1715
'rules-of-hooks': RulesOfHooks,
@@ -32,7 +30,7 @@ const legacyRecommendedConfig = {
3230

3331
// Base plugin object
3432
const reactHooksPlugin = {
35-
meta: {name, version},
33+
meta: {name: 'eslint-plugin-react-hooks'},
3634
rules,
3735
};
3836

0 commit comments

Comments
 (0)