-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
[Svelte 5] ESLint reports no-undef
on generic type parameters
#848
Comments
Is this a regression? I could've sworn it was working before.. |
{
files: ["**/*.svelte"],
languageOptions: {
parserOptions: {
parser: ts.parser,
svelteFeatures: {
experimentalGenerics: true,
}
},
},
}, Adding this to my |
I was missing the property Instead, now the
Although I have it in a /// <reference types="svelte" />
// This type is to be used to extend generics, not anywhere else.
type AnyFunction = (...args: any[]) => any; I feel like I'm adjusting window blinds here. Thanks for taking a look. |
You need to enable Please refer to the typescript-eslint FAQ for issues with |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
^9.10.0
What version of
eslint-plugin-svelte
are you using?^2.43.0
What did you do?
Configuration
What did you expect to happen?
I expected ESLint to ignore that line containing type parameters inside the
generics
attribute ofscript
.What actually happened?
ESLint caught that line and logged with:
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/karbica/repro-type-generics-no-undef
Additional comments
I'm using WXT as the boilerplate. It has nothing to do with ESLint and it doesn't come with any ESLint dependencies or configurations.
Install the dependencies and then run the lint script with whatever package manager you are using. You'll see that ESLint detects the type parameters in the Svelte component against the no-undef rule.
I'm not sure if this on the plugin to solve or the user has to hack around their own ESLint configuration file.
I'm referencing the upcoming docs here: https://github.com/sveltejs/svelte/blob/main/documentation/docs/05-misc/03-typescript.md.
The text was updated successfully, but these errors were encountered: