Skip to content

linter: eslint/no-restricted-globals doesn't behave exactly like ESLint version - types are excluded as well #14131

@osdiab

Description

@osdiab

What version of Oxlint are you using?

latest

What command did you run?

oxlint --type-aware

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

{
  "rules": {
      "no-restricted-globals": [
        "error",
        {
          name: "Date",
          message: "Use helpers or date-fns instead",
        },
      ],
  }
}

What happened?

In ESLint, it just errors if I use Date as a runtime value, in Oxlint it errors if I use it as a type as well. I want to allow using Date types since helpers return Date objects, but I don't want us to be calling new Date() because it has been a common source of time zone issues for us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions