Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaN#8295

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

StyleShit
Copy link
Contributor

Closes#8294

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@StyleShit!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedJan 23, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitb0bc73d
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65b1f444e52f120008fed03c
😎 Deploy Previewhttps://deploy-preview-8295--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🟢 up 6 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@StyleShitStyleShitforce-pushed thefix/no-useless-template-literals-infinity-nan branch fromcaf2dac to3158dadCompareJanuary 23, 2024 18:54
@StyleShitStyleShit changed the titlefix(eslint-plugin): [no-useless-template-literals] Report Infinity & NaNfix(eslint-plugin): [no-useless-template-literals] report Infinity & NaNJan 23, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesJan 24, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the quick + straightforward fix! 🧹 ✨

A couple of small thoughts, nothing blocking. Adding1 approval and setting a reminder to get to this before our next release.

expression.type === AST_NODE_TYPES.Identifier &&
expression.name === 'NaN'
);
}

Choose a reason for hiding this comment

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

[Style] Nit: both of these functions checkexpression.type === AST_NODE_TYPES.Identifier. I think it'd be just a bit cleaner code to avoid the duplicate check and instead have a single function for both. WDYT?

This is a super nitpicky nit and definitely not a blocker 😄.

A good potential followup might be to look into writing a general catch-all function for this. Searchingexpression.type === AST_NODE_TYPES.Identifier shows a few dozen results. Maybe half or more of them or so are similar calls.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, so I basically took inspiration from this:

functionisIdentifier(
init:TSESTree.Expression,
...names:string[]
):boolean{
return(
init.type===AST_NODE_TYPES.Identifier&&names.includes(init.name)
);
}

And thought about extracting it to a util, WDYT?

Choose a reason for hiding this comment

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

Probably useful to have that as a util yeah. I'm not super picky here to be honest.

@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelJan 24, 2024
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

:shipit:

@JoshuaKGoldbergJoshuaKGoldberg merged commitd02d086 intotypescript-eslint:mainJan 29, 2024
danvk pushed a commit to danvk/typescript-eslint that referenced this pull requestFeb 4, 2024
…NaN (typescript-eslint#8295)* fix(eslint-plugin): [no-useless-template-literals] report Infinity & NaNClosestypescript-eslint#8294* remove unnecessary tests
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 6, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bug: [no-useless-template-literals] Missing report forInfinity andNaN
2 participants
@StyleShit@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp