-
-
Notifications
You must be signed in to change notification settings - Fork 48
bug: no-unused-props
's option checkImportedTypes
doesn't work
#1133
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
Comments
My issue is still here on v3.2.1. This is how i define the string, this might be irrelevant because i get the errors for all primitive types passed as props: interface Properties {
currentDayCommitHash: string;
// ...
}
const {
currentDayCommitHash,
// ...
}: Properties = $props(); My eslint.config.mjs: export default typescriptEslint.config(
eslint.configs.recommended,
...typescriptEslint.configs.recommendedTypeChecked,
...svelte.configs['flat/recommended'],
...svelte.configs['flat/prettier'],
eslintPluginUnicorn.configs.recommended,
devUtilsConfigs,
eslintConfigPrettier,
{
files: ['**/*.{js,ts}'],
languageOptions: {
parser: typescriptEslint.parser,
parserOptions: {
projectService: true
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptEslint.parser,
extraFileExtensions: ['.svelte'],
projectService: true
}
},
rules: {
'svelte/require-each-key': 'off'
// 'svelte/no-unused-props': 'off'
}
}
// ...
} |
@shumadrid @AndersRobstad Could you please install the following package and confirm if it resolves your issue? I’d like to verify that the fix is correct before releasing it. npm i https://pkg.pr.new/eslint-plugin-svelte@1135 |
Yes, it's fixed for me. |
That one works for me as well, this is the case I have, it was previously complaining that properties inside this item was not used: <script lang="ts">
import Component from "./component.svelte"
import type { Item } from "../types/item"
interface Props {
item: Item;
// ...
}
let { item /* ... */ }: Props = $props();
</script>
<Component {item} /> |
Nice! Thanks for reviewing! @shumadrid @MarcusCaspeco |
This bug is fixed in v3.2.2. |
Copied from #1028 (comment)
Then the checkImportedTypes option does not seem to work correctly. In the example below the svelte-component imports the TaskViewModel-type, but it still reports errors due to some of its attributes not being used
The text was updated successfully, but these errors were encountered: