Background
Across multiple diff reports (immutability, purity, static-components), React Compiler SPECs consistently provide dual-location diagnostics: reporting both the usage site (frozen/render context) and the source site (mutation / impure call / dynamic creation).
Current ESLint rules report only a single location.
Example comparison
// Compiler: reports both the useMemo call site and the Date.now() call site
// ESLint: reports only the Date.now() call site
const now = Date.now();
return <div>{now}</div>;
Expected behavior
Explore feasibility of dual-location reporting within ESLint architecture (using context.report({ loc: [...], ... }), suggest, or data fields), and pilot it in purity and immutability rules.
Affected rules
Note: static-components is excluded because it already supports dual-location reporting (see static-components.spec.diff.md §6).
References
purity.spec.diff.md (§3)
immutability.spec.diff.md (§5)
static-components.spec.diff.md (§6)
Priority
P3 — high implementation cost (architectural change), but significant UX improvement. Best suited for long-term planning.
Background
Across multiple diff reports (
immutability,purity,static-components), React Compiler SPECs consistently provide dual-location diagnostics: reporting both the usage site (frozen/render context) and the source site (mutation / impure call / dynamic creation).Current ESLint rules report only a single location.
Example comparison
Expected behavior
Explore feasibility of dual-location reporting within ESLint architecture (using
context.report({ loc: [...], ... }),suggest, ordatafields), and pilot it inpurityandimmutabilityrules.Affected rules
purityimmutabilityReferences
purity.spec.diff.md(§3)immutability.spec.diff.md(§5)static-components.spec.diff.md(§6)Priority
P3 — high implementation cost (architectural change), but significant UX improvement. Best suited for long-term planning.