Skip to content

When using Prettier v12.1.1 together with ESLint, incorrect code deletion occurs when removing lines of code #3931

@LostElkByte

Description

@LostElkByte

Prettier Version: 12.1.1
ESLint Version: 3.0.20
Framework: Vue 3 (Setup Script)
Operating System: macOS 15 / 26.2

Steps to reproduce

  1. Write code containing a computed array in Vue 3 (see Input Code example below)
  2. Attempt to delete a single line (e.g., delete const { t } = useI18n())
  3. Trigger Prettier + ESLint auto-formatting (save file / manual formatting)
  4. Notice that the line below the deleted line is incorrectly removed
  5. This issue does NOT occur when rolling back Prettier to version 11.0.2

Input Code

<script setup lang="ts">
const { t } = useI18n()

const menuItems = computed(() => [
  { title: t("menus.mockGuide"), route: "/demo/mock" },
])
</script>

Actual Output

<script setup lang="ts">

  { title: t("menus.mockGuide"), route: "/demo/mock" },
])
</script>

Expected Output

<script setup lang="ts">

const menuItems = computed(() => [
  { title: t("menus.mockGuide"), route: "/demo/mock" },
])
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions