Your Environment
- Prettier version: 3.8.1
- node version: [24.x.x]
- package manager: [npm@11, pnpm@10]
- IDE: [Webstorm, PhpStorm, CLI]
Describe the bug
Formatting with a range adds extra empty lines after the import statements. Jetbrains IDEs use this heavily, which breaks the developer experience.
To Reproduce
I have created a reproducer:
git clone git@github.com:uncaught/trivago-prettier-plugin-sort-imports.git
cd trivago-prettier-plugin-sort-imports
npm i
npm run prettier -- --range-start=0 --range-end=53 hello.js
Expected behavior
There should only be one empty line between the import and the following code.
Actual behavior
There are four empty lines between import and following code.
Screenshots, code sample, etc
See https://github.com/uncaught/trivago-prettier-plugin-sort-imports
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
export default {
plugins: ["@trivago/prettier-plugin-sort-imports"],
};
Contribute to @trivago/prettier-plugin-sort-imports
Your Environment
Describe the bug
Formatting with a range adds extra empty lines after the import statements. Jetbrains IDEs use this heavily, which breaks the developer experience.
To Reproduce
I have created a reproducer:
git clone git@github.com:uncaught/trivago-prettier-plugin-sort-imports.git cd trivago-prettier-plugin-sort-imports npm i npm run prettier -- --range-start=0 --range-end=53 hello.jsExpected behavior
There should only be one empty line between the import and the following code.
Actual behavior
There are four empty lines between import and following code.
Screenshots, code sample, etc
See https://github.com/uncaught/trivago-prettier-plugin-sort-imports
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Contribute to @trivago/prettier-plugin-sort-imports