Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
What version of ESLint are you using?
9.22.0
What version of eslint-plugin-svelte
are you using?
3.2.1
What did you do?
Configuration
import { sentrySvelteKit } from "@sentry/sveltekit"
import { enhancedImages } from "@sveltejs/enhanced-img"
import { sveltekit } from "@sveltejs/kit/vite"
import { svelteTesting } from "@testing-library/svelte/vite"
import { defineConfig, loadEnv } from "vite"
import { purgeCss } from "vite-plugin-tailwind-purgecss"
const TRUTHY: string[] = ["true", "yes", "y", "1"] as const
export default defineConfig(({ mode }) => {
const envDir = process.cwd()
const privateEnv = loadEnv(mode, envDir, "SENTRY")
const publicEnv = loadEnv(mode, envDir, "PUBLIC_SENTRY")
const activate = TRUTHY.includes((publicEnv.PUBLIC_SENTRY_ACTIVATE ?? "").trim().toLowerCase())
const org = privateEnv.SENTRY_ORG
const project = privateEnv.SENTRY_PROJECT
const authToken = privateEnv.SENTRY_AUTH_TOKEN
if (activate) {
if (!org) console.error(`Vite config: missing environment variable SENTRY_ORG`)
if (!project) console.error("Vite config: environment variable SENTRY_PROJECT")
if (!authToken) console.error("Vite config: environment variable SENTRY_AUTH_TOKEN")
}
return {
plugins: [
sentrySvelteKit({ sourceMapsUploadOptions: { org, project, authToken } }),
enhancedImages(),
sveltekit(),
purgeCss()
],
// For Sentry
build: { sourcemap: "hidden" },
test: {
workspace: [
{
extends: "./vite.config.ts",
plugins: [svelteTesting()],
test: {
name: "client",
environment: "jsdom",
clearMocks: true,
include: ["src/**/*.svelte.{test,spec}.{js,ts}"],
exclude: ["src/lib/server/**"],
setupFiles: ["./vitest-setup-client.ts"]
}
},
{
extends: "./vite.config.ts",
test: {
name: "server",
environment: "node",
include: ["src/**/*.{test,spec}.{js,ts}"],
exclude: ["src/**/*.svelte.{test,spec}.{js,ts}"]
}
}
]
}
}
})
<!-- Paste your code here -->
What did you expect to happen?
0 warnings/errors, as version 3.1.0 did show on my code base.
What actually happened?
4893 svelte/no-unused-props errors.
For instance, this file:
<script lang="ts">
import type { SVGAttributes } from "svelte/elements"
import { SvgIcon, type IconProps } from "."
let props: {
name?: string
color?: string
size?: number | string
strokeWidth?: number | string
absoluteStrokeWidth?: boolean
class?: string
} & SVGAttributes<SVGSVGElement>= $props()
</script>
<SvgIcon viewBox="0 0 512 512" {...props}>
<path
d="M358.1 378.8L319.6 260L420.5 186.9H295.7l-38.6-118.7l-.01-.03h124.8l38.6 118.7v-.003l0.03-.02c22.4 68.8-.7 147 -62.4 192zm-201.9 0l-.036 .03L257.13 452.2L358.09 378.84L257.17 305.51ZM93.85 186.85c-23.57 72.57 3.79 149.46 62.36 192l0.01-.036L194.77 260.17L93.89 186.87H218.6L257.15 68.2L257.2 68.2H132.4Z"
fill="currentColor"
/>
</SvgIcon>
yields to:
C:\Users\xxx\src\lib\components\shared\icon\auth0.svelte
4:6 error 'name' is an unused Props property svelte/no-unused-props
4:6 error 'color' is an unused Props property svelte/no-unused-props
4:6 error 'size' is an unused Props property svelte/no-unused-props
4:6 error 'strokeWidth' is an unused Props property svelte/no-unused-props
4:6 error 'absoluteStrokeWidth' is an unused Props property svelte/no-unused-props
4:6 error 'class' is an unused Props property svelte/no-unused-props
4:6 error 'className' is an unused Props property svelte/no-unused-props
4:6 error 'height' is an unused Props property svelte/no-unused-props
4:6 error 'id' is an unused Props property svelte/no-unused-props
4:6 error 'lang' is an unused Props property svelte/no-unused-props
and hundreds more.
Link to GitHub Repo with Minimal Reproducible Example
https://github.com/bfovez/example
Additional comments
No response
Metadata
Metadata
Assignees
Labels
No labels