Open
Description
Please describe what the rule should do:
Enforce a consistent style to declare functions in script setup.
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
Option declaration
:
<!-- Good -->
<script setup>
function foobar () {}
</script>
<!-- Bad -->
<script setup>
const foo = () => {}
const bar = function () {}
</script>
import { defineComponent } from 'vue'
<!-- Good -->
export default defineComponent ({
setup() {
function foobar () {}
return {
foobar
}
}
})
<!-- Bad -->
export default defineComponent ({
setup() {
const foo = () => {}
const bar = function () {}
return {
foo,
bar,
}
}
})
Additional context
Other options:
- arrow
Refs:
Metadata
Metadata
Assignees
Labels
No labels