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] no-duplicates with type imports#2716

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

Draft
snewcomer wants to merge10 commits intoimport-js:main
base:main
Choose a base branch
Loading
fromsnewcomer:sn/fix-no-duplicates

Conversation

snewcomer
Copy link
Contributor

@snewcomersnewcomer commentedFeb 12, 2023
edited
Loading

ljharb, simmo, artur-ptaszek-mck, niklasnatter, abbasyadollahi, oceandrama, and orenklein reacted with heart emoji
@snewcomersnewcomerforce-pushed thesn/fix-no-duplicates branch 2 times, most recently fromab7a2d8 tod2292bbCompareFebruary 12, 2023 20:13
Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

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

and so on, all the loops should be iteration methods whenever possible :-)

@simmo
Copy link
Contributor

Am I correct this would fix#2675 ? If so this is my new favourite PR. 😄

If you need any testing done, I can probably help.

@runspired
Copy link

all the loops should be iteration methods whenever possible

Is there a reason for this guidance?

hbrysiewicz and oceandrama reacted with thumbs up emoji

@ljharb
Copy link
Member

@runspired loops make code harder to understand and reason about. It's explained in the airbnb styleguide as well.

oceandrama reacted with confused emoji

Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

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

Look forward to the other 2 fixes :-)

@mrm007
Copy link

Look forward to the other 2 fixes :-)

@ljharb@snewcomer I am very interested in these fixes, so I wanted to take a stab at the remaining TODO items. As it turns out, they were already covered by this PR!

I reorganised some tests (inspired bytests/src/rules/consistent-type-specifier-style.js) to prove that both TypeScript and Flow work — seesnewcomer#1

Test results
no-duplicates<snip>with types  Babel/Flow    no-duplicates      valid        ✓ import type { x } from './foo'; import y from './foo'        ✓ import type x from './foo'; import type y from './bar'        ✓ import type {x} from './foo'; import type {y} from './bar'        ✓ import type x from './foo'; import type {y} from './foo'        ✓       import type {} from './module';      import {} from './module2';            ✓       import type { Identifier } from 'module';      declare module 'module2' {        import type { Identifier } from 'module';      }      declare module 'module3' {        import type { Identifier } from 'module';      }            ✓ import { type x } from './foo'; import type y from 'foo'      invalid        ✓ import { type x } from './foo'; import y from './foo';        ✓ import type x from './foo'; import type y from './foo'        ✓ import type x from './foo'; import type x from './foo'        ✓ import type {x} from './foo'; import type {y} from './foo'        ✓ import {type x} from './foo'; import {y} from './foo'        ✓ import type {x} from './foo'; import {type y} from './foo'        ✓ import type {x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo'; import type {y} from './foo';        ✓ import {type x} from 'foo'; import type {y} from 'foo'        ✓ import {type x, C} from './foo'; import type {y} from './foo';        ✓ import type {y} from './foo'; import {type x, C} from './foo';        ✓ import {type x, C} from 'foo';import type {y} from 'foo';        ✓ import type {y} from './foo'; import {type x, C} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import {type z} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import A from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import A, { C } from './foo';        ✓ import {AValue, type x, BValue} from './foo';import {type y, CValue} from './foo';        ✓ import AValue from './foo'; import {type y} from './foo';        ✓ import {type y} from './foo';import AValue from './foo';        ✓ import AValue, {BValue} from './foo'; import {type y, CValue} from './foo';        ✓ import {AValue, type x, BValue} from './foo'; import type {y} from './foo';        ✓ import {AValue, type x, BValue} from './foo'; import type {y} from './foo'        ✓ import AValue, {type x, BValue} from './foo';import type {y} from './foo';        ✓ import AValue, {type x, BValue} from './foo'; import type {y} from './foo'        ✓ import { type C, } from './foo';import {AValue, BValue, } from './foo';  TypeScript    no-duplicates      valid        ✓ import type { x } from './foo'; import y from './foo'        ✓ import type x from './foo'; import type y from './bar'        ✓ import type {x} from './foo'; import type {y} from './bar'        ✓ import type x from './foo'; import type {y} from './foo'        ✓       import type {} from './module';      import {} from './module2';            ✓       import type { Identifier } from 'module';      declare module 'module2' {        import type { Identifier } from 'module';      }      declare module 'module3' {        import type { Identifier } from 'module';      }            ✓ import { type x } from './foo'; import type y from 'foo'      invalid        ✓ import { type x } from './foo'; import y from './foo';        ✓ import type x from './foo'; import type y from './foo'        ✓ import type x from './foo'; import type x from './foo'        ✓ import type {x} from './foo'; import type {y} from './foo'        ✓ import {type x} from './foo'; import {y} from './foo'        ✓ import type {x} from './foo'; import {type y} from './foo'        ✓ import type {x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo'; import type {y} from './foo';        ✓ import {type x} from 'foo'; import type {y} from 'foo'        ✓ import {type x, C} from './foo'; import type {y} from './foo';        ✓ import type {y} from './foo'; import {type x, C} from './foo';        ✓ import {type x, C} from 'foo';import type {y} from 'foo';        ✓ import type {y} from './foo'; import {type x, C} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import {type z} from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import A from './foo';        ✓ import {type x} from './foo';import {type y} from './foo';import A, { C } from './foo';        ✓ import {AValue, type x, BValue} from './foo';import {type y, CValue} from './foo';        ✓ import AValue from './foo'; import {type y} from './foo';        ✓ import {type y} from './foo';import AValue from './foo';        ✓ import AValue, {BValue} from './foo'; import {type y, CValue} from './foo';        ✓ import {AValue, type x, BValue} from './foo'; import type {y} from './foo';        ✓ import {AValue, type x, BValue} from './foo'; import type {y} from './foo'        ✓ import AValue, {type x, BValue} from './foo';import type {y} from './foo';        ✓ import AValue, {type x, BValue} from './foo'; import type {y} from './foo'        ✓ import { type C, } from './foo';import {AValue, BValue, } from './foo';123 passing (560ms)
runspired, ljharb, niklasnatter, and oceandrama reacted with hooray emoji

@niklasnatter
Copy link

Hey, it would be great to handle type imports withno-duplicates - Is there anything that I could help with?

acdibble, tesseractjh, and oceandrama reacted with thumbs up emoji

@mrm007
Copy link

Is there anything else we can help with to get this merged? It's a great improvement over the current behaviour.

@seanCodes
Copy link

Also eager to see this merged and happy to help where needed!

@oceandrama
Copy link

oceandrama commentedJul 14, 2023
edited
Loading

@snewcomer Hi! Sorry for mention, but this PR is super helpfull and it will be great to see this merged! Are there any additional things you would like to work on?
Maybe it also fixes#2792

@niklasnatter
Copy link

I havent tested yet, but this might be fixed by#2835

oceandrama and ljharb reacted with hooray emoji

@ljharb
Copy link
Member

I've rebased this PR, but tests seem to be failing.@mrm007 sorry i hadn't looked at your PR-PR yet - would you mind rebasing yours, and then I can pull it in?

@ljharb
Copy link
Member

@snewcomer is there a reason you overwrote my rebase?

snewcomerand others added10 commitsAugust 6, 2023 13:42
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@snewcomer
Copy link
ContributorAuthor

Hi sorry. I didn't see any commits. If I was mistaken due to keeping this PR open in Safari and not getting real time updates, I'm sorry.

FYI put a comment here.

f302f7d#r123760801

ljharb reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ljharbljharbljharb left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

8 participants
@snewcomer@simmo@runspired@ljharb@mrm007@niklasnatter@seanCodes@oceandrama

[8]ページ先頭

©2009-2025 Movatter.jp