Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imported multiple times error breaks code on format #2848

Closed
seanlail opened this issue Aug 4, 2023 · 1 comment
Closed

imported multiple times error breaks code on format #2848

seanlail opened this issue Aug 4, 2023 · 1 comment

Comments

@seanlail
Copy link

seanlail commented Aug 4, 2023

I have a Svelte component with this code:

<script lang="ts">
  import { onMount } from "svelte";
  import { spring } from 'svelte/motion';

The issue

I see this error in VSCode and when I run eslint:

  2:41  warning  '/Users/.../node_modules/svelte/types/index.d.ts' imported multiple times  import/no-duplicates
  3:24  warning  '/Users/.../node_modules/svelte/types/index.d.ts' imported multiple times  import/no-duplicates

When I save the file (I have formatOnSave enabled) it moves the spring import to the wrong module and breaks the build:

<script lang="ts">
  import { onMount, spring } from "svelte";

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/seanlail/lint-issue-556

Last commit shows the issue.
If you run this locally, remove the comment here and you will see the issue.

Versions

eslint: 8.46.0
eslint-import-resolver-typescript: 3.5.5
eslint-plugin-import: 2.28.0
eslint-plugin-svelte: 2.32.4
npm: 9.5.0
node: v18.14.2
svelte: 4.1.2
typescript: 5.1.6

Related

I created this issue in the eslint-plugin-svelte repo but have been advised the issue is with eslint-plugin-import:
sveltejs/eslint-plugin-svelte#556

@JounQin
Copy link
Collaborator

JounQin commented Aug 4, 2023

duplicate of #1479

@JounQin JounQin closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants