Skip to content

Commit 373474b

Browse files
committed
Documentation and add expose macro
1 parent c58d78f commit 373474b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/rules/define-macros-order.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ const MACROS_PROPS = 'defineProps'
1111
const MACROS_OPTIONS = 'defineOptions'
1212
const MACROS_SLOTS = 'defineSlots'
1313
const MACROS_MODEL = 'defineModel'
14-
const ORDER_SCHEMA = new Set([
14+
const MACROS_EXPOSE = 'defineExpose'
15+
const KNOWN_MACROS = new Set([
1516
MACROS_EMITS,
1617
MACROS_PROPS,
1718
MACROS_OPTIONS,
1819
MACROS_SLOTS,
19-
MACROS_MODEL
20+
MACROS_MODEL,
21+
MACROS_EXPOSE
2022
])
2123
const DEFAULT_ORDER = [MACROS_PROPS, MACROS_EMITS]
2224

@@ -133,12 +135,11 @@ function create(context) {
133135
},
134136

135137
'CallExpression:exit'(node) {
136-
// check if the node is a macro in the order
137138
if (
138139
node.callee &&
139140
node.callee.type === 'Identifier' &&
140141
order.includes(node.callee.name) &&
141-
!ORDER_SCHEMA.has(node.callee.name)
142+
!KNOWN_MACROS.has(node.callee.name)
142143
) {
143144
macrosNodes.set(node.callee.name, [getDefineMacrosStatement(node)])
144145
}
@@ -344,8 +345,7 @@ module.exports = {
344345
meta: {
345346
type: 'layout',
346347
docs: {
347-
description:
348-
'enforce order of `defineEmits` and `defineProps` compiler macros',
348+
description: 'enforce order of specified compiler macros.',
349349
categories: undefined,
350350
url: 'https://eslint.vuejs.org/rules/define-macros-order.html'
351351
},
@@ -358,8 +358,8 @@ module.exports = {
358358
order: {
359359
type: 'array',
360360
items: {
361-
type: string,
362-
minLength: 1
361+
type: 'string',
362+
minLength: 1
363363
},
364364
uniqueItems: true,
365365
additionalItems: false

0 commit comments

Comments
 (0)