You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/define-macros-order.md
+37-4
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,20 @@
2
2
pageClass: rule-details
3
3
sidebarDepth: 0
4
4
title: vue/define-macros-order
5
-
description: enforce order of `defineEmits` and `defineProps` compiler macros
5
+
description: enforce order of compiler macros (`defineProps`, `defineEmits`, etc.)
6
6
since: v8.7.0
7
7
---
8
8
9
9
# vue/define-macros-order
10
10
11
-
> enforce order of `defineEmits` and `defineProps` compiler macros
11
+
> enforce order of compiler macros (`defineProps`, `defineEmits`, etc.)
12
12
13
13
-:wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
14
14
-:bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
15
15
16
16
## :book: Rule Details
17
17
18
-
This rule reports the `defineProps`and`defineEmits`compiler macros when they are not the first statements in `<script setup>` (after any potential import statements or type definitions) or when they are not in the correct order.
18
+
This rule reports compiler macros (like `defineProps`or`defineEmits`but also custom ones) when they are not the first statements in `<script setup>` (after any potential import statements or type definitions) or when they are not in the correct order.
19
19
20
20
## :wrench: Options
21
21
@@ -28,7 +28,7 @@ This rule reports the `defineProps` and `defineEmits` compiler macros when they
28
28
}
29
29
```
30
30
31
-
-`order` (`string[]`) ... The order of defineEmits and defineProps macros. You can also add `"defineOptions"`, `"defineSlots"`, and `"defineModel"`.
31
+
-`order` (`string[]`) ... The order in which the macros should appear. The default is `["defineProps", "defineEmits"]`.
32
32
-`defineExposeLast` (`boolean`) ... Force `defineExpose` at the end.
Copy file name to clipboardExpand all lines: docs/rules/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -213,7 +213,7 @@ For example:
213
213
|[vue/component-options-name-casing](./component-options-name-casing.md)| enforce the casing of component name in `components` options |:wrench::bulb:|:hammer:|
214
214
|[vue/custom-event-name-casing](./custom-event-name-casing.md)| enforce specific casing for custom event name ||:hammer:|
215
215
|[vue/define-emits-declaration](./define-emits-declaration.md)| enforce declaration style of `defineEmits`||:hammer:|
216
-
|[vue/define-macros-order](./define-macros-order.md)| enforce order of `defineEmits` and `defineProps` compiler macros|:wrench::bulb:|:lipstick:|
216
+
|[vue/define-macros-order](./define-macros-order.md)| enforce order of compiler macros (`defineProps`, `defineEmits`, etc.)|:wrench::bulb:|:lipstick:|
217
217
|[vue/define-props-declaration](./define-props-declaration.md)| enforce declaration style of `defineProps`||:hammer:|
218
218
|[vue/enforce-style-attribute](./enforce-style-attribute.md)| enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags ||:hammer:|
219
219
|[vue/html-button-has-type](./html-button-has-type.md)| disallow usage of button without an explicit type attribute ||:hammer:|
0 commit comments