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

chore(eslint-plugin): [no-invalid-void-type] fixOptions typing to reflectminItems: 1#8312

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

kazarmy
Copy link
Contributor

PR Checklist

Overview

This PR fixes theOptions typing for theno-invalid-void-type rule so that it reflects


and alsoits documentation. I think this should be considered an extremely minor typo even though it doesn't involve documentation.

😅

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@kazarmy!

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

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit3c112d7
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65b7aed818aa3f000734d0e9
😎 Deploy Previewhttps://deploy-preview-8312--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: 88 (🔴 down 2 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.

@@ -5,7 +5,7 @@ import { getSourceCode } from '@typescript-eslint/utils/eslint-utils';
import { createRule } from '../util';

interface Options {
allowInGenericTypeArguments?: string[] | boolean;
allowInGenericTypeArguments?:[string, ...string[]] | boolean;

Choose a reason for hiding this comment

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

I suppose this makes sense technically 😄. But working with types like this can be irksome since you have to do it consistently. Is there an end-user reason for this change?

I'm not opposed to it, just curious how it came up.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oh hi 😄.

It's true that this isn't a random PR out of nowhere. I was reviewing mytypescript-eslint rule typings (I have only 4 of them and they are for a no-deadline personal project, which means that there's room for everything + the kitchen sink in it) and originally I had something like the following:

'@typescript-eslint/no-invalid-void-type'?:Linter.RuleEntry<[{allowInGenericTypeArguments?:string[]|boolean;allowAsThisParameter?:boolean;}]>;

I checkedno-invalid-void-type's documentation and noticed that the typing forallowInGenericTypeArguments had tightened up. For some reason (probably because I wanted to find out whether I can get rule typings directly fromtypescript-eslint source) I checked the rule source and noticed immediately that theOptions typing for it was out-of-date, largely because it's at the top of the file I guess.

Is there an end-user reason for this change?

I figured that the out-of-date typing would affect DX fortypescript-eslint itself, but after creating a test script inpackages/eslint-plugin/src (of thetypescript-eslint repo) and doing:

importrulesfrom'./rules';constaVar=rules['no-invalid-void-type'].create(/* ??? */);

I felt I was in a bit too deep to be comfortable, so instead of figuring out how thecreate method fits in the whole scheme of things, and then doing a "Complex Bug With a Reproduction" issue with my fork oftypescript-eslint as the repo, I figured that I'd just take my chances and go straight to a PR.

Choose a reason for hiding this comment

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

Got it, makes sense. It looks like this is the onlyminItems: 1 in a non-deprecated rule, so I guess you're setting a good precedent. Nice 😄

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.

considered an extremely minor typo even though it doesn't involve documentation

Yeah, agreed. Since it's the only one of its kind I suppose it doesn't hurt to try it out.

Thanks for sending in!

😅

@JoshuaKGoldbergJoshuaKGoldberg merged commit1d7447f intotypescript-eslint:mainFeb 3, 2024
@kazarmy
Copy link
ContributorAuthor

Thanks for merging!

🎉

danvk pushed a commit to danvk/typescript-eslint that referenced this pull requestFeb 4, 2024
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 12, 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
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kazarmy@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp