Skip to content

Commit 156b8bf

Browse files
committed
feat: add docs
1 parent ea74835 commit 156b8bf

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

docs/rules/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ For example:
233233
| [vue/no-deprecated-model-definition] | disallow deprecated `model` definition (in Vue.js 3.0.0+) | :bulb: | :warning: |
234234
| [vue/no-duplicate-attr-inheritance] | enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"` | | :hammer: |
235235
| [vue/no-empty-component-block] | disallow the `<template>` `<script>` `<style>` block to be empty | :wrench: | :hammer: |
236+
| [vue/no-import-compiler-macros] | disallow importing vue compiler macros | :wrench: | :warning: |
236237
| [vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer: |
237238
| [vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb: | :hammer: |
238239
| [vue/no-ref-object-reactivity-loss] | disallow usages of ref objects that can lead to loss of reactivity | | :warning: |
@@ -467,6 +468,7 @@ The following rules extend the rules provided by ESLint itself and apply them to
467468
[vue/no-expose-after-await]: ./no-expose-after-await.md
468469
[vue/no-extra-parens]: ./no-extra-parens.md
469470
[vue/no-implicit-coercion]: ./no-implicit-coercion.md
471+
[vue/no-import-compiler-macros]: ./no-import-compiler-macros.md
470472
[vue/no-invalid-model-keys]: ./no-invalid-model-keys.md
471473
[vue/no-irregular-whitespace]: ./no-irregular-whitespace.md
472474
[vue/no-lifecycle-after-await]: ./no-lifecycle-after-await.md
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
pageClass: rule-details
3+
sidebarDepth: 0
4+
title: vue/no-import-compiler-macros
5+
description: disallow importing vue compiler macros
6+
---
7+
8+
# vue/no-import-compiler-macros
9+
10+
> disallow importing vue compiler macros
11+
12+
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> _**This rule has not been released yet.**_ </badge>
13+
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fix-problems) can automatically fix some of the problems reported by this rule.
14+
15+
## :book: Rule Details
16+
17+
This rule disallow importing vue compiler macros.
18+
19+
<eslint-code-block fix :rules="{'vue/no-import-compiler-macros': ['error']}">
20+
21+
```vue
22+
<script setup>
23+
/* ✗ BAD */
24+
import { defineProps, withDefaults } from 'vue'
25+
</script>
26+
```
27+
28+
</eslint-code-block>
29+
30+
<eslint-code-block fix :rules="{'vue/no-import-compiler-macros': ['error']}">
31+
32+
```vue
33+
<script setup>
34+
/* ✓ GOOD */
35+
import { ref } from 'vue'
36+
</script>
37+
```
38+
39+
</eslint-code-block>
40+
41+
## :wrench: Options
42+
43+
Nothing.
44+
45+
## :mag: Implementation
46+
47+
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-import-compiler-macros.js)
48+
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-import-compiler-macros.js)

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ const plugin = {
127127
'no-expose-after-await': require('./rules/no-expose-after-await'),
128128
'no-extra-parens': require('./rules/no-extra-parens'),
129129
'no-implicit-coercion': require('./rules/no-implicit-coercion'),
130+
'no-import-compiler-macros': require('./rules/no-import-compiler-macros'),
130131
'no-invalid-model-keys': require('./rules/no-invalid-model-keys'),
131132
'no-irregular-whitespace': require('./rules/no-irregular-whitespace'),
132133
'no-lifecycle-after-await': require('./rules/no-lifecycle-after-await'),

0 commit comments

Comments
 (0)