-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Your Environment
- Prettier version: 3.5.3
- node version: 20
- package manager: npm@10
- IDE: WebStorm & CLI
Describe the bug
When using --range-start
/ --range-end
to format for example a single import statement.
Extra blank lines are added after the import.
To Reproduce
-
Install dependencies:
{ "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.4.1", "prettier": "^3.5.3", "typescript": "^5.4.3" }, }
-
Create a file hello.ts:
import { Component, OnInit } from "@angular/core";
//
- Create config
trailingComma: "es5"
semi: true
singleQuote: false
arrowParens: always
bracketSpacing: true
quoteProps: as-needed
htmlWhitespaceSensitivity: ignore
plugins:
- "@ianvs/prettier-plugin-sort-imports"
importOrderParserPlugins:
- "typescript"
- "classProperties"
- "decorators"
importOrder:
- "^@angular(/.*)?$"
- ""
- "^primeng(/.*)?$"
- ""
- <THIRD_PARTY_MODULES>
- ""
- "^@app(/.*)?$"
- ""
- "^(\\.).*$"
importOrderTypeScriptVersion: 4.7.4
- Run Prettier with this command:
prettier --range-start=0 --range-end=53 hello.ts
- Actual output:
import { Component, OnInit } from "@angular/core";
//
Expected behavior
import { Component, OnInit } from "@angular/core";
//
Error log
No error — just unexpected formatting.
p-mazhnik and giotramu
Metadata
Metadata
Assignees
Labels
No labels