File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ For example:
233
233
| [ vue/no-deprecated-model-definition] | disallow deprecated ` model ` definition (in Vue.js 3.0.0+) | :bulb : | :warning : |
234
234
| [ vue/no-duplicate-attr-inheritance] | enforce ` inheritAttrs ` to be set to ` false ` when using ` v-bind="$attrs" ` | | :hammer : |
235
235
| [ 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 : |
236
237
| [ vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer : |
237
238
| [ vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb : | :hammer : |
238
239
| [ 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
467
468
[ vue/no-expose-after-await ] : ./no-expose-after-await.md
468
469
[ vue/no-extra-parens ] : ./no-extra-parens.md
469
470
[ vue/no-implicit-coercion ] : ./no-implicit-coercion.md
471
+ [ vue/no-import-compiler-macros ] : ./no-import-compiler-macros.md
470
472
[ vue/no-invalid-model-keys ] : ./no-invalid-model-keys.md
471
473
[ vue/no-irregular-whitespace ] : ./no-irregular-whitespace.md
472
474
[ vue/no-lifecycle-after-await ] : ./no-lifecycle-after-await.md
Original file line number Diff line number Diff line change
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 )
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ const plugin = {
127
127
'no-expose-after-await' : require ( './rules/no-expose-after-await' ) ,
128
128
'no-extra-parens' : require ( './rules/no-extra-parens' ) ,
129
129
'no-implicit-coercion' : require ( './rules/no-implicit-coercion' ) ,
130
+ 'no-import-compiler-macros' : require ( './rules/no-import-compiler-macros' ) ,
130
131
'no-invalid-model-keys' : require ( './rules/no-invalid-model-keys' ) ,
131
132
'no-irregular-whitespace' : require ( './rules/no-irregular-whitespace' ) ,
132
133
'no-lifecycle-after-await' : require ( './rules/no-lifecycle-after-await' ) ,
You can’t perform that action at this time.
0 commit comments