{"repo":"nickjvandyke/eslint-plugin-react-you-might-not-need-an-effect","free":true,"listed":false,"github":"https://github.com/nickjvandyke/eslint-plugin-react-you-might-not-need-an-effect","clone":"git clone https://github.com/nickjvandyke/eslint-plugin-react-you-might-not-need-an-effect.git","description":"🙅‍♂️ Catch unnecessary React effects for simpler, faster, safer code.","language":"JavaScript","stars":1896,"topics":["eslint","eslint-plugin","eslint-rules","react","react-hooks","reactjs"],"license":"MIT","category":"ui-components","readme_excerpt":"ESLint – React – You Might Not Need An Effect ESLint (and Oxlint) plugin to catch unnecessary useEffect s to make your React code easier to follow, faster to run, and less error-prone. Highly recommended for new React developers as you learn its mental model, and might surprise even experienced developers! - Actionable fixes: Reports specific anti-patterns, with suggestions and links. - Deep analysis: Analyzes state, props, refs, and their upstream sources. - Dependency-aware: Considers when an effect runs to determine if its logic is actually redundant. - Edge-case obsessed: Focuses on unusual syntax and heuristics to keep the signal-to-noise ratio high. React's eslint-plugin-react-hooks/set-state-in-effect rule flags synchronous setState calls inside effects, helping prevent unnecessary re-renders. However, unnecessary effects go far beyond this, as I'm sure we've all seen (or written 😅). 📦 Installation NPM Yarn ⚙️ Configuration Flat Config Legacy Config Oxlint Use this plugin with Oxlint thanks to their JS plugin support! Suggested Enforce these other rules in your codebase for more accurate analysis: - react-hooks/exhaustive-deps — the plugin assumes your effects receive correct dependencies. - typescript-eslint/no-floating-promises — helps the plugin infer calls to asynchronous functions. 🔎 Rules See the tests for extensive (in)valid examples for each rule. no-derived-state Disallow storing derived state in an effect: no-chain-state-updates Disallow chaining state upd","default_branch":null,"files":null,"tree":[],"storefront":"/r/nickjvandyke","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nickjvandyke/eslint-plugin-react-you-might-not-need-an-effect/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}