--range-{start,end} is ignored for --config-precedence=prefer-file
Open
Nobody has claimed this yet.
area:cli
area:ranges
help wanted
type:editor support
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Environments:
- Prettier Version: 2.3.0
- Running Prettier via: CLI
- Runtime: v16
- Operating System: Linux, macOS
- Prettier plugins (if any):
Steps to reproduce:
- Create file
file.js
import { a } from 'a' ;
import {b, c } from 'b-c';
- Create file
.prettierrc.js
module.exports = {}
- Run
cat file.js | prettier --stdin-filepath file.js --config-precedence=file-override --range-start 9 --range-end 10
import { a } from "a";
import {b, c } from 'b-c';
- Run
cat file.js | prettier --stdin-filepath file.js --config-precedence=prefer-file --range-start 9 --range-end 10
import { a } from "a";
import { b, c } from "b-c";
Expected behavior:
Both output should be the same.
Actual behavior:
--config-precedence=prefer-file ignores --range-start and --range-end flags.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with file.js, .prettierrc.js, and the two prettier CLI commands shown in the report. Start by tracing CLI handling for --config-precedence, --range-start, and --range-end; done means both precedence modes produce the same range-limited output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100