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

feat(eslint-plugin): [restrict-template-expressions] addallowArray option#8389

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

abrahamguo
Copy link
Contributor

@abrahamguoabrahamguo commentedFeb 6, 2024
edited
Loading

PR Checklist

Overview

I've added a newallowArray option that applies the existing checks fromrestrict-template-expressions recursively (i.e. noundefineds, etc.).

I haven't added unit tests yet but I'd like to begin receiving feedback on this change.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@abrahamguo!

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 commentedFeb 6, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit9a3c36a
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65eef16041aa3f0008d14d3d
😎 Deploy Previewhttps://deploy-preview-8389--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: 94 (🟢 up 4 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.

@abrahamguoabrahamguo changed the titleWAddallowArray option forrestrict-template-expressionsfeat: AddallowArray option forrestrict-template-expressionsFeb 6, 2024
@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedFeb 6, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit9a3c36a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 31 targets

Sent with 💌 fromNxCloud.

@abrahamguoabrahamguo changed the titlefeat: AddallowArray option forrestrict-template-expressionsfeat: addallowArray option forrestrict-template-expressionsFeb 12, 2024
@codecovCodecov
Copy link

codecovbot commentedFeb 19, 2024
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.20%. Comparing base(c0e3267) to head(9a3c36a).

Additional details and impacted files
@@            Coverage Diff             @@##             main    #8389      +/-   ##==========================================- Coverage   87.21%   87.20%   -0.01%==========================================  Files         251      251                Lines       12315    12308       -7       Branches     3883     3875       -8     ==========================================- Hits        10740    10733       -7  Misses       1305     1305                Partials      270      270
FlagCoverage Δ
unittest87.20% <100.00%> (-0.01%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

FilesCoverage Δ
...-plugin/src/rules/restrict-template-expressions.ts100.00% <100.00%> (ø)

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.

This is a clever way of automating the repeated parts 🙂. Nicely done.

...but like many clever code things, there was a difficulty cost of reading it at first. I played around with it locally and found it easier to read through with a few small structural changes. What do you think?

Aaron Ashmore in character in some sci fi show saying "Nifty!", impressed

abrahamguo reacted with thumbs up emoji
@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelFeb 23, 2024
@github-actionsgithub-actionsbot removed the awaiting responseIssues waiting for a reply from the OP or another party labelFeb 26, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesMar 5, 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.

Super, looks good to me! Thanks for all the code tinkering. 😄

Leaving open with1 approval as I know at least@bradzacher has had well-informed thoughts on this family of rules in the past.

abrahamguo reacted with hooray emoji
@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelMar 5, 2024
@bradzacherbradzacher changed the titlefeat: addallowArray option forrestrict-template-expressionsfeat(eslint-plugin): [restrict-template-expressions] addallowArray optionMar 16, 2024
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
recursivelyCheckType(type.getNumberIndexType()!),
],
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
Copy link
Member

Choose a reason for hiding this comment

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

@JoshuaKGoldberg - Originally this rule's purpose was to prevent code likenode.type === 'string'.
Given we now have theno-unsafe-enum-comparison rule - do you think this internal rule still has value? WDYT about deleting it? (we already have nuec turned on via the recommended config)

Choose a reason for hiding this comment

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

Yeah I'd be in favor of that. It wouldn't be the first example of an internal lint rule ending up as a subset of a general good one.

bradzacher reacted with thumbs up emoji
@bradzacherbradzacher merged commite4b1672 intotypescript-eslint:mainMar 16, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

@bradzacherbradzacherbradzacher 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.

Enhancement: [restrict-template-expressions] More permissive type check
3 participants
@abrahamguo@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp