-
Notifications
You must be signed in to change notification settings - Fork 152
Open
Labels
Description
Your Environment
- Prettier version: 3.5.3
- node version: 20.x.x
- package manager: [email protected]
- IDE: VScode
Describe the bug
When running pnpm lint or pnpm format, the import sorting plugin fails on Markdown files with the error:[prettier-plugin-sort-imports]: import sorting aborted due to babel parsing error
To Reproduce
- Create a Markdown file in the project
- Run
prettier --write --list-different . - The error occurs even though Markdown files don't contain imports
Error log
.md [error] [prettier-plugin-sort-imports]: import sorting aborted due to babel parsing error
Expected behavior
Markdown files should be formatted normally without triggering import sorting.
Screenshots, code sample, etc
The error occurs in files like:.md
Configuration File
{
"semi": true,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"printWidth": 84,
"arrowParens": "always",
"trailingComma": "all",
"importOrder": [
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
"<THIRD_PARTY_MODULES>",
"",
"^@.*",
"",
"^[./]"
],
"tailwindAttributes": ["theme"],
"tailwindFunctions": ["clsx", "cva", "tw", "cn", "twMerge", "createTheme"],
"importOrderParserPlugins": [
"typescript",
"jsx",
"decorators-legacy",
"classProperties"
],
"plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
"proseWrap": "always"
}lancej1022