Skip to content

Meta: fix some no-optional-chaining lint issues - #9405

Merged
fregante merged 10 commits into
mainfrom
optional
May 11, 2026
Merged

fregante merged 10 commits into
mainfrom
optional

Conversation

@fregante

@fregante fregante commented May 9, 2026

Copy link
Copy Markdown
Member

The rule earned its right to exist. I'll merge this PR after the next release because this kind of changes is inherently risky, see #9401 (comment)

@github-actions github-actions Bot added the meta Related to Refined GitHub itself label May 9, 2026
if (location.hash.startsWith('#issuecomment-')) {
$closestOptional(timelineItem, $optional(`.${collapsedClassName} ${location.hash}`))
?.classList
$closest(timelineItem, $(`.${collapsedClassName} ${location.hash}`))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user linked to it, GitHub certainly loaded it. If this fails, it's a race condition and it should be fixed

}

$optional('.octicon', link)?.remove();
$('.octicon', link).remove();

@fregante fregante May 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't find a situation where the icon is missing

$([
'li:has([data-content="Projects"])',
'[data-menu-item$="projects-tab"]', // TODO: Drop in October 2026
]).remove();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both tabs are expected to exist, right?

@fregante
fregante marked this pull request as ready for review May 10, 2026 17:30
@fregante fregante changed the title Meta: fix some no-optional-chaining lint issues Meta: fix some no-optional-chaining lint issues May 10, 2026
@fregante
fregante merged commit 60a34ef into main May 11, 2026
13 checks passed
@SunsetTechuila
SunsetTechuila deleted the optional branch May 18, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta Related to Refined GitHub itself

Development

Successfully merging this pull request may close these issues.

Fix a few no-optional-chaining suppressions

1 participant