Skip to content

linter: eslint/no-use-before-define support nofunc option #23074

Description

@Sysix

What version of Oxlint are you using?

latest

What command did you run?

No response

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{
  "categories": {
    "correctness": "off"
  },
  "plugins": ["react"],
  "rules": {
    "no-use-before-define": ["error", "nofunc"]
  }
}

What happened?

ESLint upstream rules supports as a second argument a string too.
https://eslint.org/docs/latest/rules/no-use-before-define#nofunc

This will remap to the config-object functions property:
https://github.com/eslint/eslint/blob/243b8c56014bbbe63771185b0731d8dd4d1316e9/lib/rules/no-use-before-define.js#L28-L44

We have pass-tests for this, but not failing one.
https://github.com/oxc-project/oxc/blob/main/crates/oxc_linter/src/rules/eslint/no_use_before_define.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions