Registry / testing / eslint-plugin-react-no-manual-memo

eslint-plugin-react-no-manual-memo

JSON →
library1.0.4jsnpmunverified

ESLint plugin for codebases using React Compiler. Flags manual memoization patterns (useMemo, useCallback, React.memo) to remind developers to let the compiler optimize automatically. Current version 1.0.4, actively developed, ships TypeScript types. Provides three rules: no-component-memo (auto-fixable), no-hook-memo (auto-fixable), and no-custom-memo-hook. Includes a recommended flat config for ESLint 9+. Peer dependency on eslint ^8.57.0 || ^9.0.0. Key differentiator: specifically targets React Compiler users, unlike generic eslint-plugin-react.

npm install eslint-plugin-react-no-manual-memo
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REAC
E
eslint-plugin-react-no-manual-memo
testingjavascriptv1.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import reactNoManualMemo from 'eslint-plugin-react-no-manual-memo'
✗ const reactNoManualMemo = require('eslint-plugin-react-no-manual-memo')
Plugin ships ESM only; CommonJS require may work depending on bundler but ESM is recommended.
rules
✓ import { rules } from 'eslint-plugin-react-no-manual-memo'
✗ const { rules } = require('eslint-plugin-react-no-manual-memo')
Access individual rule definitions via named export. ESM only.
configs
✓ import { configs } from 'eslint-plugin-react-no-manual-memo'
Use configs['flat/recommended'] for ESLint 9+ flat config.

Setup eslint-plugin-react-no-manual-memo with recommended flat config for ESLint 9+ and example of individual rule configuration.

// Install: npm install --save-dev eslint-plugin-react-no-manual-memo // ESLint flat config (eslint.config.js) import { defineConfig } from 'eslint/config'; import reactNoManualMemo from 'eslint-plugin-react-no-manual-memo'; export default defineConfig([ reactNoManualMemo.configs['flat/recommended'], ]); // Or use individual rules import reactNoManualMemo from 'eslint-plugin-react-no-manual-memo'; export default [ { plugins: { 'react-no-manual-memo': reactNoManualMemo }, rules: { 'react-no-manual-memo/no-hook-memo': 'error', 'react-no-manual-memo/no-component-memo': 'warn', 'react-no-manual-memo/no-custom-memo-hook': 'warn', } } ];
Debug
Known issues
breakingv1.0.4 changed 'no-hook-memo' from warn to error in recommended config. If your build treats warnings as errors, expect new failures.
fix
Set rule severity explicitly: 'react-no-manual-memo/no-hook-memo': 'warn' in your config if you want warnings.
affects: >=1.0.4
gotchaFlat config (ESLint 9+) must be wrapped in defineConfig() from eslint/config when using plugin configs directly. ESLint throws an error otherwise.
fix
Use defineConfig() as shown in the README, or apply config array directly per ESLint docs.
affects: >=1.0.0
gotchaPlugin is ESM-only. Projects using CommonJS may encounter import issues. Ensure your ESLint config is an ES module or use dynamic import.
fix
Use 'import' syntax, or rename config file to .mjs, or set 'type': 'module' in package.json.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'eslint-plugin-react-no-manual-memo'
Plugin not installed or not in node_modules.
fix
Run 'npm install --save-dev eslint-plugin-react-no-manual-memo'.
ESLint: Error: 'react-no-manual-memo' config is not defined
Attempting to use flat config without wrapping in defineConfig() or using incorrect config key.
fix
Use reactNoManualMemo.configs['flat/recommended'] inside defineConfig() array.
ESLint: Unexpected top-level property 'plugins'
Using flat config style but ESLint version < 9, or mixing config formats.
fix
Use ESLint 9+ for flat config, or use .eslintrc.* format for older versions.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for running ESLint plugin
Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-react-no-manual-memo — npm install eslint-plugin-react-no-manual-memo · libregistry