From 6f6d7e8224398777a62234644319869bf66d2baf Mon Sep 17 00:00:00 2001 From: David Anson Date: Mon, 23 Dec 2024 22:48:32 +0000 Subject: [PATCH] Reword configuration file name exception text for clarity (fixes #481). --- markdownlint-cli2.mjs | 5 +++-- test/markdownlint-cli2-test-cases.mjs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/markdownlint-cli2.mjs b/markdownlint-cli2.mjs index f3d046d..2aaeeba 100755 --- a/markdownlint-cli2.mjs +++ b/markdownlint-cli2.mjs @@ -172,8 +172,9 @@ const readOptionsOrConfig = async (configPath, fs, noImport) => { config = await importModule(dirname, basename, noImport); } else { throw new Error( - "File name should be (or end with) one of the supported types " + - "(e.g., '.markdownlint.json' or 'example.markdownlint-cli2.jsonc')." + "Configuration file should be one of the supported names " + + "(e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name " + + "(e.g., 'example.markdownlint-cli2.jsonc')." ); } } catch (error) { diff --git a/test/markdownlint-cli2-test-cases.mjs b/test/markdownlint-cli2-test-cases.mjs index 41f1c50..cd0278f 100644 --- a/test/markdownlint-cli2-test-cases.mjs +++ b/test/markdownlint-cli2-test-cases.mjs @@ -722,7 +722,7 @@ const testCases = ({ "args": [ "--config", "cfg/unrecognized.jsonc", "**/*.md" ], "exitCode": 2, "stderrRe": - /Unable to use configuration file '[^']*cfg\/unrecognized\.jsonc'; File name should be \(or end with\) one of the supported types \(e\.g\., '\.markdownlint\.json' or 'example\.markdownlint-cli2\.jsonc'\)\./u, + /Unable to use configuration file '[^']*cfg\/unrecognized\.jsonc'; Configuration file should be one of the supported names \(e\.g\., '\.markdownlint-cli2\.jsonc'\) or a prefix with a supported name \(e\.g\., 'example\.markdownlint-cli2\.jsonc'\)\./u, "cwd": "config-files" });