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): [require-types-exports] add rule#10554

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

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Continuation of@StyleShit's#8443 as indicated in#8443 (comment).

Co-authored-by:@StyleShit

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewDecember 26, 2024 19:48
@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as draftDecember 26, 2024 19:52
@codecovCodecov
Copy link

codecovbot commentedDec 26, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is88.94737% with21 lines in your changes missing coverage. Please review.

Project coverage is 86.88%. Comparing base(3ae4148) to head(e09b7d9).
Report is 150 commits behind head on main.

Current heade09b7d9 differs from pull request most recent head8dc9607

Pleaseupload reports for the commit8dc9607 to get more accurate results.

Files with missing linesPatch %Lines
...s/eslint-plugin/src/rules/require-types-exports.ts88.52%12 Missing and 9 partials⚠️

❌ Your patch status has failed because the patch coverage (88.94%) is below the target coverage (90.00%). You can increase the patch coverage or adjust thetarget coverage.

Additional details and impacted files
@@            Coverage Diff             @@##             main   #10554      +/-   ##==========================================+ Coverage   86.86%   86.88%   +0.02%==========================================  Files         445      446       +1       Lines       15455    15640     +185       Branches     4507     4545      +38     ==========================================+ Hits        13425    13589     +164- Misses       1675     1687      +12- Partials      355      364       +9
FlagCoverage Δ
unittest86.88% <88.94%> (+0.02%)⬆️

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

Files with missing linesCoverage Δ
...lugin-internal/src/rules/plugin-test-formatting.ts82.79% <ø> (ø)
packages/eslint-plugin/src/rules/array-type.ts97.26% <ø> (ø)
packages/eslint-plugin/src/rules/await-thenable.ts100.00% <ø> (ø)
packages/eslint-plugin/src/rules/ban-ts-comment.ts100.00% <ø> (ø)
...t-plugin/src/rules/class-literal-property-style.ts100.00% <ø> (ø)
.../eslint-plugin/src/rules/class-methods-use-this.ts91.30% <ø> (ø)
...lugin/src/rules/consistent-generic-constructors.ts90.24% <ø> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts97.89% <ø> (ø)
...kages/eslint-plugin/src/rules/consistent-return.ts93.75% <ø> (ø)
...int-plugin/src/rules/consistent-type-assertions.ts94.82% <ø> (ø)
... and74 more

@@ -31,9 +31,9 @@ interface Config {
};
}

type Options = [Config];
exporttype Options = [Config];
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: Next rule has I lined the options and does not have Config as separate type. Maybe for consistency this type could be inlined too, if you are doing another PR just for these export changes :) Or if the separate Config type is preferred, maybe there could be some follow up
task for unifying these.
I don’t feel like this would matter if they would stay as internal types. But after they are exposed to “public”, it would look better if they had unified names. :)

Copy link
Contributor

@rubiesontheskyrubiesonthesky left a comment
edited
Loading

Choose a reason for hiding this comment

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

I know this is a draft, but just few suggestions to not to export empty types.

Edit: I should have left these comments on the another PR which is just about the type
exports 😅

type Options = [];
type MessageIds = 'useTopLevelQualifier';
exporttype Options = [];
exporttype MessageIds = 'useTopLevelQualifier';

export default createRule<Options, MessageIds>({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
exportdefaultcreateRule<Options,MessageIds>({
exportdefaultcreateRule<[],MessageIds>({

@@ -10,8 +10,8 @@ import {
NullThrowsReasons,
} from '../util';

type Options = [];
type MessageIds = 'useTopLevelQualifier';
export type Options = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type Options = [];

(no longer needed)

type Options = [];
type MessageIds = 'unaryMinus';
exporttype Options = [];
exporttype MessageIds = 'unaryMinus';

export default util.createRule<Options, MessageIds>({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
exportdefaultutil.createRule<Options,MessageIds>({
exportdefaultutil.createRule<[],MessageIds>({

@@ -3,8 +3,8 @@ import * as ts from 'typescript';

import * as util from '../util';

type Options = [];
type MessageIds = 'unaryMinus';
export type Options = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type Options = [];

@JoshuaKGoldberg
Copy link
MemberAuthor

I'm not going to have time for this anytime soon. Closing out so someone else can tackle this "fun" rule if they want. 🙂

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@rubiesontheskyrubiesontheskyrubiesonthesky left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Rule proposal: Export all types used in exports
3 participants
@JoshuaKGoldberg@rubiesonthesky@StyleShit

[8]ページ先頭

©2009-2025 Movatter.jp