Rule Change: Add suggestions to `no-eq-null`
Author: Pixel998Created Jul 21, 2026Updated Sep 22, 2026
Labelsenhancementruleaccepted
What rule do you want to change?
no-eq-null
What change do you want to make?
Implement suggestions
How do you think the change should be implemented?
Other
Example code
/* eslint no-eq-null: "error" */
if (value == null) {
doSomething();
}
if (value != null) {
doSomethingElse();
}What does the rule currently do for this code?
The rule reports both comparisons without providing suggestion to fix the code.
What will the rule do after it's changed?
The rule will provide suggestions to replace the operator:
if (value === null) {
doSomething();
}
if (value !== null) {
doSomethingElse();
}Participation
- I am willing to submit a pull request to implement this change.
AI acknowledgment
- I did not use AI to generate this issue report.
- (If the above is not checked) I have reviewed the AI-generated content before submitting.
Additional comments
No response
Source: eslint/eslint