github sveltejs/eslint-plugin-svelte eslint-plugin-svelte@3.24.0

3 hours ago

Minor Changes

  • #1553 8cca2e0 Thanks @marekdedic! - feat(no-navigation-without-resolve): track resolve() through array elements, object properties and {#each} iteration variables

Patch Changes

  • #1380 9944910 Thanks @baseballyama! - fix(no-navigation-without-resolve): check complete rel tokens before exempting external links

  • #1566 e49015d Thanks @arpitjain099! - fix(no-unused-props): fix false positives and negatives around spreads, aliases, dotted keys, and props that share a type

  • #1516 7538afa Thanks @kevin-easygo! - fix(no-reactive-functions): use isSpaceBetween instead of isSpaceBetweenTokens, which was removed in ESLint v10

  • #1618 7999ad4 Thanks @baseballyama! - fix(valid-compile): read the parser from context.languageOptions.parserOptions, since context.parserOptions was removed in ESLint v10

  • #1606 78def78 Thanks @ozenyunus35! - Allow a comment before a closing token in svelte/indent to be aligned with the previous line instead of requiring the indentation of the closing token.

  • #1581 3b308f3 Thanks @badreddinesaadioui! - fix(prefer-svelte-reactivity): stop reporting in legacy (non-runes) components, where the svelte/reactivity classes are not tracked

  • #1627 36abd30 Thanks @baseballyama! - Fix false positives in svelte/no-unused-props:

    • The props object is destructured (e.g. const { a } = props). A destructured key now counts as used when its binding is used, and an unused one is reported. Nested destructuring (e.g. const { name } = user) can now report unused nested properties, the same as user.name.
    • The props object is used as a whole (e.g. $inspect(props) or fn(props)). Every property now counts as used. A type query like typeof props.a is not counted as a use.
    • A dynamic key like user[key] now counts as using every property of user.
    • Numeric and template literal keys like props[0].a and props[`a`], and wrapped values like props!.a, (props as Props).a and (props satisfies Props).a are now tracked.
    • Instances of generic classes are now skipped like other class instances.
    • With allowUnusedNestedProperties, nested properties are never reported.
    • Class members that cannot be read from outside (#foo, private, protected) are no longer reported, e.g. in intersections.
  • #1629 5e0c7bf Thanks @baseballyama! - Stop svelte/no-unused-svelte-ignore from reporting svelte-ignore comments for runtime warnings (e.g. ownership_invalid_binding), which the compiler can't report.

  • #1626 9aa3a7a Thanks @baseballyama! - Require postcss@^8.5.10 to avoid GHSA-qx2v-qp2m-jg93.

  • #1613 80e66ec Thanks @smile-alive! - fix(sort-attributes): do not report or move shorthand attributes and directives across spread attributes

  • #1635 cf11995 Thanks @baseballyama! - fix(require-store-reactive-access): with type information, don't report callable stores used as functions, actions, transitions, or event handlers, and stores from function calls such as getContext() checked with ?? / ??= with a store fallback. Don't auto-fix stores that are not declared at the top level, are used in the module script, or are on the left side of ||= / &&= / ??=.

  • #1616 a972353 Thanks @eknathdj! - Honor svelte-ignore comments on nested script nodes in svelte/no-unused-svelte-ignore and svelte/valid-compile (Svelte 5), and no longer treat a comment at the end of the previous line as an ignore comment for the next node.

  • #1648 ae85b36 Thanks @baseballyama! - chore: update svelte-eslint-parser to 1.10.1

  • #1625 9b859e3 Thanks @baseballyama! - Pass compilerOptions.runes from the Svelte config to the compiler in svelte/valid-compile and svelte/no-unused-svelte-ignore, so runes-mode warnings are reported for files that rely on runes: true. The function form (runes: ({ filename }) => ...) is also supported.

Don't miss a new eslint-plugin-svelte release

NewReleases is sending notifications on new releases.