Skip to content

linter: macros error no-undef #14987

@elec7reify

Description

@elec7reify

What version of Oxlint are you using?

1.24.0

What command did you run?

oxlint . --ignore-path .gitignore

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

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["vue", "vitest", "import"],
  "env": {
    "browser": true
  },
  "rules": {
    "eqeqeq": "warn",
    "no-unused-vars": "warn",
    "no-undef": "error",
    "prefer-const": "error",
    "no-var": "warn",
    "import/no-cycle": "warn",
    "vue/no-import-compiler-macros": "error",
    "vue/no-export-in-script-setup": "error",
    "vitest/no-import-node-test": "error"
  }
}

What happened?

I turned on the "no-undef" rule and got errors about defineProps, defineModel and other Vue macros in the <script setup> that they were not defined:
× eslint(no-undef): 'defineProps' is not defined. ╭─[file:///E:/project/src/components/Service.vue:6:15] 5 │ 6 │ const props = defineProps({ · ─────────── 7 │ serviceName: { ╰────

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions