# no-import-compiler-macros

Rule `vue/no-import-compiler-macros`. Disallow importing Vue compiler macros

- Source: vue
- Technologies: Vue
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #478 by reach, #113 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vue/no-import-compiler-macros` | no | safe | package `eslint-plugin-vue` | [docs](https://eslint.vuejs.org/rules/no-import-compiler-macros.html) |
| Oxlint | `vue/no-import-compiler-macros` | no | unsafe | plugin `vue`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/vue/no-import-compiler-macros.html) |
| Biome | `correctness/noVueImportCompilerMacros` | yes | no | group correctness, since 2.4.15 | [docs](https://biomejs.dev/linter/rules/no-vue-import-compiler-macros/) |

## Code examples

### Incorrect: the rule reports this

```vue
<script setup>
import { defineProps, withDefaults } from 'vue'
</script>
```

### Correct: the rule accepts this

```vue
<script setup>
import { ref } from 'vue'
</script>
```

Examples from the Oxlint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vue from "eslint-plugin-vue";

export default [
  {
    plugins: { vue },
    rules: {
      "vue/no-import-compiler-macros": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "vue"
  ],
  "rules": {
    "vue/no-import-compiler-macros": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noVueImportCompilerMacros": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [vue/next-tick-style](https://lintradar.dev/rules/vue/next-tick-style.md): Enforce Promise or callback style in `nextTick`
- [vue/enforce-style-attribute](https://lintradar.dev/rules/vue/enforce-style-attribute.md): Enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags
- [vue/no-boolean-default](https://lintradar.dev/rules/vue/no-boolean-default.md): Disallow boolean defaults
- [vue/no-root-v-if](https://lintradar.dev/rules/vue/no-root-v-if.md): Disallow `v-if` directives on root element
- [vue/no-unused-emit-declarations](https://lintradar.dev/rules/vue/no-unused-emit-declarations.md): Disallow unused emit declarations
- [vue/prefer-define-options](https://lintradar.dev/rules/vue/prefer-define-options.md): Enforce use of `defineOptions` instead of default export

---

Web page: https://lintradar.dev/rules/vue/no-import-compiler-macros. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
