prettier/prettier
View on GitHub--range-{start,end} is ignored for --config-precedence=prefer-file
Open
#13,354 opened on Aug 24, 2022
area:cliarea:rangeshelp wantedtype:editor support
Repository metrics
- Stars
- (51,868 stars)
- PR merge metrics
- (Avg merge 6d) (186 merged PRs in 30d)
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.