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-empty-interface] disable autofix for declaration merging with class#5920

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

Merged
JoshuaKGoldberg merged 5 commits intotypescript-eslint:mainfromyeonjuan:fix/#5273
Nov 18, 2022

Conversation

@yeonjuan
Copy link
Contributor

PR Checklist

Overview

@nx-cloud
Copy link

nx-cloudbot commentedNov 2, 2022
edited
Loading

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 46 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@yeonjuan!

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.

@netlify
Copy link

netlifybot commentedNov 2, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit1e4f021
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/6377a8eeee47cf000944e738
😎 Deploy Previewhttps://deploy-preview-5920--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@codecov
Copy link

codecovbot commentedNov 2, 2022
edited
Loading

Codecov Report

Merging#5920 (1e4f021) intomain (7a10707) willincrease coverage by0.00%.
The diff coverage is100.00%.

Additional details and impacted files
@@           Coverage Diff           @@##             main    #5920   +/-   ##=======================================  Coverage   91.27%   91.28%           =======================================  Files         366      366             Lines       12348    12352    +4       Branches     3610     3612    +2     =======================================+ Hits        11271    11275    +4  Misses        768      768             Partials      309      309
FlagCoverage Δ
unittest91.28% <100.00%> (+<0.01%)⬆️

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

Impacted FilesCoverage Δ
...ages/eslint-plugin/src/rules/no-empty-interface.ts100.00% <100.00%> (ø)

@yeonjuanyeonjuan marked this pull request as ready for reviewNovember 3, 2022 08:52
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.

Great stuff, thanks for sending this in@yeonjuan! 🎊

Mostly requesting changes on getting more test coverage. Would be nice to see a bit of refactoring to reduce the lines of code too.


// Check if interface is within ambient declaration
letuseAutoFix=true;
lethasSuggest=true;

Choose a reason for hiding this comment

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

Nit: I found it confusing how the previous variable starts withuse but this starts withhas, even though they're pretty much the same thing. Can we make the names more similar?

Suggested change
lethasSuggest=true;
letuseSuggestion=true;

Note: after applying the refactor I suggest later in the file, the variable might be unnecessary.


if(util.isDefinitionFile(filename)){
constscope=context.getScope();
if(scope.type==='tsModule'&&scope.block.declare){

Choose a reason for hiding this comment

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

[Nit] Now that theconst scope = ... line is earlier, these twoif statements can be combined:

if(util.isDefinitionFile(filename)&&scope.type==="tsModule"&&scope.block.declare){useAutoFix=false;}

...so the code can be simplified a bit more, to giveuseAutoFix an initial value:

letuseAutoFix= ...;

I would even suggest making a separate variable for whether it's merged with a class declaration:

constmergedWithClassDeclaration=scope.set.get(node.id.name)?.defs?.some((def)=>def.node.type===AST_NODE_TYPES.ClassDeclaration);constuseAutoFix=!mergedWithClassDeclaration&& ...;

Thoughts?

@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelNov 15, 2022
@yeonjuan
Copy link
ContributorAuthor

@JoshuaKGoldberg Thanks for the review!. I fixed it and add some test cases

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.

Fantastic, thanks for iterating on this with me@yeonjuan! It looks great ✨

@JoshuaKGoldbergJoshuaKGoldberg merged commita4f85b8 intotypescript-eslint:mainNov 18, 2022
omril1 pushed a commit to omril1/typescript-eslint that referenced this pull requestNov 23, 2022
…ion merging with class (typescript-eslint#5920)* fix(eslint-plugin): [no-empty-interface] disable autofix for declaration merging with class* fix comment* fix lint* Apply review
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsNov 26, 2022
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

awaiting responseIssues waiting for a reply from the OP or another party

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: [no-empty-interface] autofix break typescript

2 participants

@yeonjuan@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp