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): [init-declarations] refine report locations#8893

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

kirkwaiblinger
Copy link
Member

PR Checklist

Overview

/* eslint @typescript-eslint/init-declarations: ["error", "always"] */// beforeletbar:number|undefined|string;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^// afterletbar:number|undefined|string;^^^

Note that the following example is unchanged

/* eslint @typescript-eslint/init-declarations: ["error", "never"] */letbar:number|undefined|string=3;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@kirkwaiblinger!

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 commentedApr 10, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit769eddc
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/665fb9afbd2b2000080e6f18
😎 Deploy Previewhttps://deploy-preview-8893--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: 95 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (🔴 down 8 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.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedApr 10, 2024
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit769eddc. 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.

@kirkwaiblingerkirkwaiblinger changed the titlefix(eslint-plugin): [init-declarations] refine report locfix(eslint-plugin): [init-declarations] refine report locationsApr 10, 2024
@kirkwaiblingerkirkwaiblingerforce-pushed theinit-declarations-refine-report-loc branch from6b5d7c2 to06bfce3CompareApril 10, 2024 07:25
@kirkwaiblingerkirkwaiblingerforce-pushed theinit-declarations-refine-report-loc branch from06bfce3 to7ff131dCompareApril 10, 2024 07:26
@kirkwaiblingerkirkwaiblinger marked this pull request as ready for reviewApril 10, 2024 07:42
@kirkwaiblingerkirkwaiblinger added the enhancementNew feature or request labelMay 4, 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, sorry for missing this till now! 🚀

It'd be nice to try to get this fixed more cleanly in ESLint core... but my hunch is we don't have a super high chance of that getting accepted.

Hades from the Disney Hercules movie giving two flaming thumbs up

kirkwaiblinger reacted with laugh emoji
? reportOverride
: Reflect.get(context, prop, receiver),
});
}

Choose a reason for hiding this comment

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

😬 It's a little awkward having toProxy the base rule. Is there an issue that was ever filed on ESLint about better handling of report locations in this case? I couldn't find one. But even if it's declined as out-of-scope, it'd be good for reference.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm not sure... I basically copied this pattern from

// we can't directly proxy `context` because its `report` property is non-configurable
// and non-writable. So we proxy `customContext` and redirect all
// property access to the original context except for `report`
constproxiedContext=newProxy<typeofcontext>(
customContextastypeofcontext,
{
get(target,path,receiver):unknown{
if(path!=='report'){
returnReflect.get(context,path,receiver);
}
returnReflect.get(target,path,receiver);
},
},
);

and

// we can't directly proxy `context` because its `report` property is non-configurable
// and non-writable. So we proxy `customContext` and redirect all
// property access to the original context except for `report`
returnnewProxy<Context>(customContextastypeofcontext,{
get(target,path,receiver):unknown{
if(path!=='report'){
returnReflect.get(context,path,receiver);
}
returnReflect.get(target,path,receiver);
},
});

And modified it with stylistic preferences.

Following the trail through the git history, it doesn't look like any investigation into alternatives or issues with eslint were documented in those.

(breadcrumbs)

Will plan to check for eslint issues on the topic before this PR gets merged

Choose a reason for hiding this comment

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

before this PR gets merged

Oh@kirkwaiblinger I was going to merge today for the Monday release and consider this a followup. But in that case I'll just let you merge whenever you want.

kirkwaiblinger reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Followup makes sense to me too! 👍
Happy for us to merge for the release

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelJun 2, 2024
@kirkwaiblingerkirkwaiblinger merged commitfbff4ce intotypescript-eslint:mainJun 5, 2024
61 checks passed
@kirkwaiblingerkirkwaiblinger deleted the init-declarations-refine-report-loc branchJune 5, 2024 02:09
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJun 15, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees

@kirkwaiblingerkirkwaiblinger

Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we mergeenhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kirkwaiblinger@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp