Open
Description
Describe the bug
When I migrated from svelte 4 to 5, I began to get eslint errors always involving any
or "error typed value". After a lot of debugging, I discovered that this issues were limited to files that imported from 'svelte-modals'. I tried to understand why this was the case, but couldn't make progress.
Reproduction
- Create a svelte project with eslint enabled using
npx sv
. - Utilize
svelte-modals
(svelte 5 api, not legacy). - Enable type-checked linting. The modified
eslint.config.js
will look similar to excerpt below. - Open
.svelte
or.ts
files that import and utilizesvelte-modals
apis. There will be spurious eslint errors, but the code still works and typescript intellisense still understands the types.
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';
export default ts.config(
js.configs.recommended,
...ts.configs.recommendedTypeChecked,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.svelte'],
},
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
);
Additional context
Note that my repository is a monorepo, but based on my analysis it does not seem related to this issue.
Awesome tool btw! I've been using it for more than a year.