Meta: fix some no-optional-chaining lint issues#9399
Conversation
There was a problem hiding this comment.
$optional restored with comment
| 'Confirm bypass rules and merge (squash)', | ||
| ].includes(textContent) | ||
| ) { | ||
| if (!/squash/i.test($(confirmMergeButton).textContent)) { |
There was a problem hiding this comment.
/sq/i will also work. However, that doesn't mean we should use it. It's very unlikely these labels will change anytime soon, so let's keep it safe
There was a problem hiding this comment.
let's keep it safe
What failure type are you expecting from look for "squash" string in "merge button label"?
| 'Confirm bypass rules and merge (squash)', | ||
| ].includes(textContent) | ||
| ) { | ||
| if (!/squash/i.test($(confirmMergeButton).textContent)) { |
There was a problem hiding this comment.
Let's share the logic with sync-pr-commit-title instead of duplicating it
There was a problem hiding this comment.
If I have to restore $optional I don’t think it can be shared
| $optional('[aria-checked="true"]', menu)?.setAttribute('aria-checked', 'false'); | ||
| currentFilter.setAttribute('aria-checked', 'true'); | ||
| } | ||
| } |
| event.currentTarget.blur(); | ||
|
|
||
| // Prevent multiple clicks | ||
| event.currentTarget.disabled = true; |
There was a problem hiding this comment.
In this case we'll also get events for the hidden hotkey button, but there's no drawbacks in temporarily disabling that one too.
| } | ||
|
|
||
| const commitSha = await getLatestCommitToFile(url.branch, url.filePath); | ||
| if (!commitSha) { |
There was a problem hiding this comment.
A file exists, so its commit also exists
There was a problem hiding this comment.
$optional restored with comment
no-optional-chaining issuesno-optional-chaining lint issues
|
Should be good as a first pass |
|
Merging. If you find further tweaks please include them in https://github.com/refined-github/refined-github/tree/code-tweaks-and-fixes |
no-optional-chainingsuppressions #9395