You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/eslint-plugin-react-x/src/rules/purity/purity.spec.diff.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,9 @@ Detection uses only `IMPURE_FUNCS` and `IMPURE_CTORS`. Although `lib.ts` also ex
40
40
-**ESLint**: only names present in `IMPURE_FUNCS` or `IMPURE_CTORS` are candidates.
41
41
-**ESLint aliases**: `resolveBuiltinObjectName` follows simple variable-initializer chains to a global root, such as `const M = Math` and `const D = Date`.
42
42
-**ESLint shadowing**: parameters, imports, function declarations, and other local definitions do not resolve as built-ins; implicit or unresolved globals do.
43
-
-**ESLint constructors**: constructors in `IMPURE_CTORS` are reported, except`new Date(arg)`is allowed when at least one argument is present; zero-argument `new Date()` is reported.
43
+
-**ESLint constructors**: constructors in `IMPURE_CTORS` are reported, including`new Date(...)`with or without arguments.
44
44
45
-
**Verdict**: Alias, shadowing, and the `new Date(arg)` exception are explicit ESLint behaviors. The cited React fixture does not establish corresponding upstream behavior.
45
+
**Verdict**: Aliasand shadowing are explicit ESLint behaviors. `new Date(...)` constructor calls are reported like the other constructors in `IMPURE_CTORS`.
46
46
47
47
## 3. Reporting
48
48
@@ -69,7 +69,7 @@ There is no current upstream dual-location diagnostic to reproduce. The React ex
69
69
70
70
- React's active branch, option gate, signature check, `Purity` category, reason, and single call location.
71
71
- The standalone React validator is present but not connected to `Pipeline.ts`.
72
-
- ESLint's exclusive use of `IMPURE_FUNCS` / `IMPURE_CTORS`, component-hook ownership check, alias resolution, shadowing handling, and `new Date(arg)` exception.
72
+
- ESLint's exclusive use of `IMPURE_FUNCS` / `IMPURE_CTORS`, component-hook ownership check, alias resolution, shadowing handling, and Date constructor handling.
0 commit comments