Skip to content

Commit a0b5731

Browse files
authored
feat(vue): move vue/define-macros-order rule to stylistic preset (#17)
1 parent 485c0cf commit a0b5731

4 files changed

Lines changed: 19 additions & 11 deletions

File tree

docs/oxlint/UNSUPPORTED-RULES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@
268268
- `vue/order-in-components`
269269
- `vue/this-in-template`
270270
- `vue/define-props-declaration`
271-
- `vue/define-macros-order`
272271
- `vue/no-import-compiler-macros`
273272
- `vue/no-undef-components`
274273
- `vue/no-unused-emit-declarations`
@@ -300,6 +299,7 @@
300299
- `vue-a11y/no-static-element-interactions`
301300
- `vue-a11y/role-has-required-aria-props`
302301
- `vue-a11y/tabindex-no-positive`
302+
- `vue/define-macros-order`
303303
- `astro/missing-client-only-directive-value`
304304
- `astro/no-conflict-set-directives`
305305
- `astro/no-deprecated-astro-canonicalurl`

src/configs/vue.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Linter } from 'eslint'
33
export interface VueOptions {
44
typescript?: boolean
55
prettier?: boolean
6+
stylistic?: boolean
67
a11y?: boolean
78
}
89

src/configs/vue.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ export function vue(options = {}) {
4949
// Additional
5050
'vue/block-order': ['error', { order: ['script', 'template', 'style'] }],
5151
'vue/define-props-declaration': ['error', 'type-based'],
52-
'vue/define-macros-order': ['error', {
53-
order: [
54-
'defineOptions',
55-
'defineProps',
56-
'defineModel',
57-
'defineEmits',
58-
'defineSlots',
59-
],
60-
defineExposeLast: true,
61-
}],
6252
'vue/no-import-compiler-macros': 'error',
6353
'vue/no-undef-components': ['error', {
6454
ignorePatterns: [
@@ -101,6 +91,22 @@ export function vue(options = {}) {
10191
}
10292
: {},
10393

94+
// Stylistic
95+
...options.stylistic
96+
? {
97+
'vue/define-macros-order': ['error', {
98+
order: [
99+
'defineOptions',
100+
'defineProps',
101+
'defineModel',
102+
'defineEmits',
103+
'defineSlots',
104+
],
105+
defineExposeLast: true,
106+
}],
107+
}
108+
: {},
109+
104110
// Disabled for compatibility with Prettier
105111
...options.prettier
106112
? {

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export function defineConfig(options, ...userConfigs) {
8888
vue({
8989
typescript: options.typescript,
9090
prettier: enablePrettier,
91+
stylistic: enableStylistic !== false,
9192
...vueOptions,
9293
}),
9394
)

0 commit comments

Comments
 (0)