Repository navigation
fix: respect overrides of manual configs #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "semi": true, | ||
| "overrides": [ | ||
| { | ||
| "files": "src/*.js", | ||
| "options": { | ||
| "semi": false | ||
| } | ||
| }, | ||
| { | ||
| "files": "../lib/*.js", | ||
| "options": { | ||
| "semi": false | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| const x = "foo"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| const x = "foo"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| const x = "foo"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { runCli } from "../utils"; | ||
|
|
||
| describe("--config-path in another dir resolves override globs relative to the config file", () => { | ||
| runCli("config-path-other-dir", [ | ||
| "--config-path", | ||
| "config/prettier.json", | ||
| "config/src/foo.js", | ||
| ]).test({ | ||
| status: 0, | ||
| stdout: `const x = "foo"`, | ||
| stderr: "", | ||
| write: [], | ||
| }); | ||
| }); | ||
|
|
||
| describe("--config-path in another dir does not resolve override globs relative to the cwd", () => { | ||
| runCli("config-path-other-dir", [ | ||
| "--config-path", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Classic CLI uses https://prettier.io/docs/next/cli#--find-config-path-and---config
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this has always used
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "config/prettier.json", | ||
| "src/foo.js", | ||
| ]).test({ | ||
| status: 0, | ||
| stdout: `const x = "foo";`, | ||
| stderr: "", | ||
| write: [], | ||
| }); | ||
| }); | ||
|
|
||
| describe("--config-path in another dir resolves override globs pointing outside the config dir", () => { | ||
| runCli("config-path-other-dir", [ | ||
| "--config-path", | ||
| "config/prettier.json", | ||
| "lib/foo.js", | ||
| ]).test({ | ||
| status: 0, | ||
| stdout: `const x = "foo"`, | ||
| stderr: "", | ||
| write: [], | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just
a//b/orfoobarinstead ofsrc//lib/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no particular reason. its just what i was testing it against so the fixture ended up the same name.
happy to change it if needed