diff --git a/src/cli/util.js b/src/cli/util.js index 4ec80b64..15f86b3d 100644 --- a/src/cli/util.js +++ b/src/cli/util.js @@ -339,7 +339,9 @@ function formatFiles(context) { const fileIgnored = ignorer.filter([filename]).length === 0; if ( fileIgnored && - (context.argv["write"] || context.argv["list-different"]) + (context.argv["debug-check"] || + context.argv["write"] || + context.argv["list-different"]) ) { return; } diff --git a/tests_integration/__tests__/__snapshots__/ignore-path.js.snap b/tests_integration/__tests__/__snapshots__/ignore-path.js.snap index 11e9966c..b748a30d 100644 --- a/tests_integration/__tests__/__snapshots__/ignore-path.js.snap +++ b/tests_integration/__tests__/__snapshots__/ignore-path.js.snap @@ -1,5 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`ignore file when using --debug-check (stderr) 1`] = `""`; + +exports[`ignore file when using --debug-check (stdout) 1`] = ` +"other-regular-modules.js +" +`; + +exports[`ignore file when using --debug-check (write) 1`] = `Array []`; + exports[`ignore path (stderr) 1`] = `""`; exports[`ignore path (stdout) 1`] = ` diff --git a/tests_integration/__tests__/ignore-path.js b/tests_integration/__tests__/ignore-path.js index ce5d1aa2..b4afa66e 100644 --- a/tests_integration/__tests__/ignore-path.js +++ b/tests_integration/__tests__/ignore-path.js @@ -19,6 +19,12 @@ describe("support .prettierignore", () => { }); }); +describe("ignore file when using --debug-check", () => { + runPrettier("cli/ignore-path", ["**/*.js", "--debug-check"]).test({ + status: 0 + }); +}); + describe("outputs files as-is if no --write", () => { runPrettier("cli/ignore-path", ["regular-module.js"]).test({ status: 0