Skip to content

fix(eslint): account for all config formats#994

Merged
jycouet merged 26 commits intosveltejs:mainfrom
sacrosanctic:shaky-barnacle
Apr 2, 2026
Merged

fix(eslint): account for all config formats#994
jycouet merged 26 commits intosveltejs:mainfrom
sacrosanctic:shaky-barnacle

Conversation

@sacrosanctic
Copy link
Copy Markdown
Contributor

@sacrosanctic sacrosanctic commented Mar 18, 2026

I spotted the problem when looking at https://github.com/hyunbinseo/svelte-kit-templates/blob/b200ae76d7bb2c61e6e695c4d90912666d39256c/javascript/eslint.config.js. I had to test eslint by hand.

We should add a test, could someone lend me hand?

That repo was quite helpful, maybe we can expand on the templates we take snapshots for?

  • missing type

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 18, 2026

🦋 Changeset detected

Latest commit: 4074d63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@svelte-docs-bot
Copy link
Copy Markdown

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 18, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@994
npx https://pkg.pr.new/sv@994
npx https://pkg.pr.new/@sveltejs/sv-utils@994

commit: 4074d63

Copy link
Copy Markdown
Member

@manuel3108 manuel3108 left a comment

Choose a reason for hiding this comment

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

Which problem exactly are you trying to solve in this file? https://github.com/hyunbinseo/svelte-kit-templates/blob/b200ae76d7bb2c61e6e695c4d90912666d39256c/javascript/eslint.config.js I don't think im following currently.

Don't mind the comments below, it's just so that we don't forget about them.

@sacrosanctic
Copy link
Copy Markdown
Contributor Author

Which problem exactly are you trying to solve in this file?

@manuel3108

prettier and svelte.configs.prettier are supposed to be right after svelte.configs.recommended.

The original only partially supported the following cases, [], defineConfig(), and defineConfig([]). It now also handles svelte.configs.recommended whether it is spread or not.

@sacrosanctic sacrosanctic changed the title fix(eslint): handle various templates fix(eslint): account for all config formats Mar 28, 2026
@sacrosanctic sacrosanctic marked this pull request as ready for review March 28, 2026 14:43
@sacrosanctic
Copy link
Copy Markdown
Contributor Author

@jycouet

Added some of the changes from #943 to lighten the load there.

Is the CI telling me i need to make that change in the svelte.dev repo?

Should we have more snapshots?

Copy link
Copy Markdown
Contributor

@jycouet jycouet left a comment

Choose a reason for hiding this comment

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

I didn't get what is the root cause of this PR?

@sacrosanctic
Copy link
Copy Markdown
Contributor Author

Not too familiar with the AST, cannot move the comment inside the object.

@jycouet
Copy link
Copy Markdown
Contributor

jycouet commented Apr 1, 2026

Not too familiar with the AST, cannot move the comment inside the object.

Nah, I don't manage too. esrap manage before or after node, but not inside. (I think it's not needed, it's ok)
I updated with 1 existing rule. WDYT? (if you have a better rule idea, that's good for me too)

Let me know

Copy link
Copy Markdown
Contributor Author

@sacrosanctic sacrosanctic left a comment

Choose a reason for hiding this comment

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

LGTM

@jycouet jycouet merged commit 73745c5 into sveltejs:main Apr 2, 2026
8 checks passed
@github-actions github-actions bot mentioned this pull request Apr 2, 2026
@sacrosanctic sacrosanctic deleted the shaky-barnacle branch April 2, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants