-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(eslint-plugin): [prefer-nullish-coalescing] doesn't report on ternary but on equivalent || #10517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JoshuaKGoldberg
merged 38 commits into
typescript-eslint:main
from
OlivierZal:prefer-nullish-coalescing-10470
Jan 23, 2025
Merged
fix(eslint-plugin): [prefer-nullish-coalescing] doesn't report on ternary but on equivalent || #10517
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
f663f69
prefer-nullish-coalescing: handle Identifier and UnaryExpression in
OlivierZal 214e56e
remove useless return
OlivierZal c0ffe54
add tests
OlivierZal 08dcde6
create intermediate constants for clarity
OlivierZal bde98e9
move line
OlivierZal d6fa559
add tests
OlivierZal ec6c08f
add more tests
OlivierZal 5734d33
add ouput
OlivierZal 7ff3d6d
renaming + migrate some utils from rules to util folder
OlivierZal 0274a0c
remove redundant tests
OlivierZal d92734e
remove useless return
OlivierZal 7a85531
handle MemberExpression
OlivierZal eca7196
keep no-unnecessary-condition utils update for another PR
OlivierZal c8d56b3
add tests
OlivierZal 0494327
renaming
OlivierZal ab5d7d8
add tests for new utils
OlivierZal d6cc757
re-add utils in no-unnecessary-condition for utils coverage
OlivierZal ec87f63
anticipate optional chain handling
OlivierZal cf22e92
Merge branch 'main' into prefer-nullish-coalescing-10470
OlivierZal 23b095b
align behaviour with || one
OlivierZal 5c67422
simplify
OlivierZal 313f5e4
fix eslint
OlivierZal 24424ea
align behaviour on || one
OlivierZal c2e9ab0
renaming
OlivierZal 0bc81d4
Merge branch 'main' into prefer-nullish-coalescing-10470
OlivierZal 70e5aeb
change break line
OlivierZal 80c0221
Add tests for primitives + ternary
OlivierZal ddb404c
Add tests for primitives + ternary
OlivierZal 28eeac8
Merge branch 'main' into prefer-nullish-coalescing-10470
OlivierZal 2cfb35c
align options for as much use cases as possible
OlivierZal 993d6b1
add tests for ternary + bool coercion
OlivierZal 4822bb4
fixes and add test ternary + conditional
OlivierZal 2defdf4
suggestion
kirkwaiblinger dce2427
Merge pull request #2 from kirkwaiblinger/pnc-suggestion
OlivierZal 5bd6b4e
Merge branch 'main' into prefer-nullish-coalescing-10470
OlivierZal 80f3a20
fix lint
OlivierZal 469bd65
Update packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
OlivierZal b771c7f
nits
OlivierZal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Praise] Really nice refactors here. Love to see a -62 line count on a rule 😄