Skip to content

prefer-define-options should insert defineOptions after import expressions #2263

Closed
@fisker

Description

@fisker

What rule do you want to change?

Imporve autofix.

Does this change cause the rule to produce more or fewer warnings?

Same.

How will the change be implemented? (New option, new default behavior, etc.)?

N/A

Please provide some example code that this change will affect:

<script setup>
import {ref} from 'vue'
</script>

<script>
export default {inheritAttrs: true}
</script>

What does the rule currently do for this code?

Currently fix to:

<script setup>
defineOptions({inheritAttrs: true})

import {ref} from 'vue'
</script>

What will the rule do after it's changed?

Expect fix to:

<script setup>
import {ref} from 'vue'

defineOptions({inheritAttrs: true})
</script>

Additional context

Playground

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions