Releases: sathvikc/eslint-plugin-strict-hooks
Releases · sathvikc/eslint-plugin-strict-hooks
v0.2.0
v0.1.0
eslint-plugin-strict-hooks
🚀 v0.1.0 – Initial Release
Adds a new ESLint rule to enforce meaningful comments when disabling react-hooks/exhaustive-deps.
✅ New Rule: require-exhaustive-deps-comment
This rule ensures developers explicitly mention which dependencies are intentionally omitted from the dependency array when disabling react-hooks/exhaustive-deps.
🔧 Valid Example
useEffect(() => {
fetchData();
}, []); // eslint-disable-line react-hooks/exhaustive-deps -- fetchData: memoized❌ Invalid Example
useEffect(() => {
fetchData();
}, []); // eslint-disable-line react-hooks/exhaustive-deps🎯 What it Detects
- ✅ Dependencies used but not mentioned in the disable comment
- ✅ Stale entries: variables mentioned in the comment that are no longer used
- ✅ Empty
--comment when dependencies are omitted
🔧 Configurable Options
rules: {
"strict-hooks/require-exhaustive-deps-comment": ["warn", {
enabledHooks: ["useEffect", "useMemo", "useCallback"],
requireCommentPerDependency: true,
disabledHooks: []
}]
}🧠 Limitations
- No autofix (yet)
- Does not support destructured/memoized property tracking
- Does not resolve shadowed identifiers
Full Changelog: https://github.com/sathvikc/eslint-plugin-strict-hooks/commits/v0.1.0