mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user