Skip to content

linter: Nusery no-undef fails on Svelte runes #11662

@KieranP

Description

@KieranP

What version of Oxlint are you using?

1.1.0

What command did you run?

oxlint

What does your .oxlintrc.json config file look like?

{
  "rules": {
    "eslint/no-undef": "error"
  }
}

What happened?

Wasn't sure if you want reports for nursery rules, but the eslint/no-undef rule currently fails on Svelte runes, $state, $derived, $props, etc, reporting them as undefined, which they are in the code, but they get replaced when Svelte script is compiled. I understand you don't have full Svelte support yet, so an "ignore" option for the no-undef rule would be quite handy, without adding them to globals, because they aren't available everywhere e.g.

{
  "rules": {
    "eslint/no-undef": "error"
  },
  "overrides": [
    {
      "files": ["*.svelte"],
      "rules": {
        "eslint/no-undef": [
          "error",
          { "ignore": ["$state", "$derived", "$props"] }
        ]
      }
    }
  ]
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions