prettier / prettier/eslint-plugin-prettier

When saving with the cursor before a word, the first letter gets swallowed.

Open
#783 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.7k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

This project create by pnpm create vue@latest and add eslint-plugin-prettier.
And i remove pluginPrettier from eslint.config.ts, it can work, although it doesn't follow Prettier's formatting.

eslint.config.ts

import { globalIgnores } from 'eslint/config'
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
import pluginVue from 'eslint-plugin-vue'
import pluginVitest from '@vitest/eslint-plugin'
import pluginOxlint from 'eslint-plugin-oxlint'
import pluginPrettier from 'eslint-plugin-prettier/recommended'

export default defineConfigWithVueTs(
  {
    name: 'app/files-to-lint',
    files: ['**/*.{vue,ts,mts,tsx}'],
  },

  globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),

  ...pluginVue.configs['flat/essential'],
  vueTsConfigs.recommended,

  {
    ...pluginVitest.configs.recommended,
    files: ['src/**/__tests__/*'],
  },

  ...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),

  // Just add this
  // After removing it, the issue of words being swallowed upon saving no longer occurs.
  pluginPrettier,
)

.oxlintrc.json

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["eslint", "typescript", "unicorn", "oxc", "vue"],
  "env": {
    "browser": true
  },
  "categories": {
    "correctness": "error"
  }
}

.vscode/settings.json

{
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit"
  }
}

package.json

{
  "devDependencies": {
    "@alova/wormhole": "^1.5.0",
    "@iconify/json": "^2.2.435",
    "@tsconfig/node24": "^24.0.4",
    "@types/jsdom": "^27.0.0",
    "@types/lodash-es": "^4.17.12",
    "@types/node": "^24.10.9",
    "@unocss/eslint-config": "^66.6.0",
    "@vitejs/plugin-vue": "^6.0.3",
    "@vitejs/plugin-vue-jsx": "^5.1.3",
    "@vitest/eslint-plugin": "^1.6.6",
    "@vue/eslint-config-typescript": "^14.6.0",
    "@vue/test-utils": "^2.4.6",
    "@vue/tsconfig": "^0.8.1",
    "eslint": "^9.39.2",
    "eslint-config-prettier": "^10.1.8",
    "eslint-plugin-oxlint": "~1.46.0",
    "eslint-plugin-prettier": "^5.5.5",
    "eslint-plugin-vue": "~10.7.0",
    "jiti": "^2.6.1",
    "jsdom": "^27.4.0",
    "naive-ui": "^2.43.2",
    "npm-run-all2": "^8.0.4",
    "oxlint": "~1.47.0",
    "prettier": "~3.8.1",
    "sass": "^1.97.3",
    "sass-loader": "^16.0.6",
    "typescript": "~5.9.3",
    "unocss": "^66.6.0",
    "unplugin-auto-import": "^21.0.0",
    "unplugin-vue-components": "^31.0.0",
    "unplugin-vue-router": "^0.19.2",
    "vite": "^7.3.1",
    "vite-plugin-vue-devtools": "^8.0.5",
    "vitest": "^4.0.18",
    "vue-tsc": "^3.2.4"
  }
}

https://github.com/user-attachments/assets/3a2b68b8-fa3a-4fed-9c74-92faa7142514

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior using eslint.config.ts, .vscode/settings.json, and the listed package versions, with eslint-plugin-prettier enabled alongside oxlint and save-time fixes. Compare saving with the plugin enabled and removed; done means the first character remains intact while Prettier formatting still applies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.