Skip to content

fix(eslint): use recommendedTypeChecked - #1202

Merged
jycouet merged 35 commits into
sveltejs:mainfrom
sacrosanctic:hidden-landfowl
Nov 17, 2026
Merged

jycouet merged 35 commits into
sveltejs:mainfrom
sacrosanctic:hidden-landfowl

Conversation

@sacrosanctic

@sacrosanctic sacrosanctic commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #938

Description

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Install the latest version of sv from 248940d:

pnx https://pkg.svelte.dev/sv/c/248940d39bfa70771bfe4cfbe9d2b5993c32ddc5 create

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1202

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 248940d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@sacrosanctic
sacrosanctic marked this pull request as draft July 30, 2026 17:18
@sacrosanctic
sacrosanctic marked this pull request as ready for review July 31, 2026 02:53
Comment thread packages/sv/src/addons/better-auth.ts Resolved
@sacrosanctic

Copy link
Copy Markdown
Contributor Author
 ❯  addons  tests/eslint/test.ts (4 tests | 1 failed) 185289ms
   ✓ eslint 'kit-js'  113307ms
   ✓ eslint 'kit-ts'  113306ms
   ✓ eslint 'vite-js'  113306ms
   × eslint 'vite-ts' 173888ms (retry x3)

I don't understand how this project is structured. It has 2 tsconfig.json's.

@AdrianGonz97

Copy link
Copy Markdown
Member

While looking into the lint failure for #1202 (comment), I started to go through the new lint rules (this list only contains what's added by recommendedTypeChecked to recommended).

I'm left wondering if the preset rules for recommendedTypeChecked may be too opinionated, or perhaps contain some questionable defaults?

For example, I can already foresee no-floating-promises becoming a problem when it comes to deferred query refreshes with remote functions.

something like this:

const foo = form(() => {
	// ...stuff happens
	
	query1().refresh() // lint error!
	query2().refresh() // lint error!
})

could erroneously lead people down the very wrong path of awaiting these refreshes:

const foo = form(() => {
	// ...stuff happens

	// oops! these no longer run concurrently!
	await query1().refresh()
	await query2().refresh()
})

however, while adding void query1().refresh() may dismiss the lint error, that 'fix' will not be everyone's first instinct.

only-throw-error could be an issue with thrown a redirect, though i haven't tested it so i can't be certain at the moment.

I also vaguely remember require-await being the source of some annoying issues when we first tried to enable it for this repo, but I'm not able to recall exactly why. Do you guys (@manuel3108, @benmccann) happen to remember?

@sacrosanctic

Copy link
Copy Markdown
Contributor Author

Good stuff, definitely things to consider, hopefully this PR can create the discussion needed to merge this or to close the original issue. Will have to do more exploration with the new APIs.

however, while adding void query1().refresh() may dismiss the lint error, that 'fix' will not be everyone's first instinct.

It is part of the lint error, maybe we can overwrite it with our own custom error msg?

only-throw-error could be an issue with thrown a redirect

Don't think this is an issue, we don't throw error or redirect.

@manuel3108

Copy link
Copy Markdown
Member

I also vaguely remember require-await being the source of some annoying issues when we first tried to enable it for this repo, but I'm not able to recall exactly why. Do you guys (@manuel3108, @benmccann) happen to remember?

Sadly i don't remember any of this. But I see your points.

Do I see that correctly, that this PR tries to change the setup for new projects (sv create) and our own codebase? I mean it totally makes sense, just trying to understand the scope of this PR

@manuel3108
manuel3108 changed the base branch from main to version-1 August 7, 2026 07:42
@manuel3108

Copy link
Copy Markdown
Member

Changed target branch and resolved produced merge conflicts

@manuel3108
manuel3108 marked this pull request as draft August 21, 2026 16:18
sacrosanctic added a commit to sacrosanctic/cli that referenced this pull request Sep 24, 2026
@sacrosanctic

Copy link
Copy Markdown
Contributor Author

@manuel3108 This pr is ready to go. But @AdrianGonz97 mentions some issues for the upcoming async svelte with regards to conflicting eslint rules. We may need to fix them by providing our own modified versions, similar to svelte/prefer-const.

@benmccann pinging previously mentioned parties

@manuel3108
manuel3108 marked this pull request as ready for review November 15, 2026 12:42
@manuel3108 manuel3108 added the needs-addon-integration-tests Run the addon integration test suite label Nov 15, 2026

@manuel3108 manuel3108 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's give this a try and see what users think. We can always revert if we receive complaints

@manuel3108

Copy link
Copy Markdown
Member

Seems like we let this PR sit for too long, it has quite a lot of failing ci jobs

@sacrosanctic

Copy link
Copy Markdown
Contributor Author

Will rebase now that a decision has been made.

Comment thread packages/sv/src/addons/eslint.ts Outdated
// the project service (file is in a tsconfig) or `allowDefaultProject` —
// never both. the addon adds the config file to the tsconfig include for
// Kit 3 projects with a tsconfig, which decides which side it is on
const configInTsconfigProject = isKit3(kitVersion) && fileExists(cwd, 'tsconfig.json');

@sacrosanctic sacrosanctic Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This check isn't very good. vite-ts's tsconfig is the main reason for the issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread package.json Resolved
@jycouet
jycouet merged commit 91d0af5 into sveltejs:main Nov 17, 2026
9 of 10 checks passed
@sacrosanctic
sacrosanctic deleted the hidden-landfowl branch November 17, 2026 16:47
@hyunbinseo

Copy link
Copy Markdown
Contributor

This shipped in sv@1.6.0 without a changeset, so it's missing from the changelog. Since it can surface new lint errors, could it be added to the 1.6.0 notes?

@sacrosanctic

Copy link
Copy Markdown
Contributor Author

Seems like we forgot.

@manuel3108

Copy link
Copy Markdown
Member

Thanks for the heads up, see #1497

jycouet pushed a commit that referenced this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-addon-integration-tests Run the addon integration test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider using recommendedTypeChecked with typescript-eslint

5 participants