Skip to content

Commit 6f6d7e8

Browse files
committed
Reword configuration file name exception text for clarity (fixes #481).
1 parent 7b3ac50 commit 6f6d7e8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

markdownlint-cli2.mjs

+3-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ const readOptionsOrConfig = async (configPath, fs, noImport) => {
172172
config = await importModule(dirname, basename, noImport);
173173
} else {
174174
throw new Error(
175-
"File name should be (or end with) one of the supported types " +
176-
"(e.g., '.markdownlint.json' or 'example.markdownlint-cli2.jsonc')."
175+
"Configuration file should be one of the supported names " +
176+
"(e.g., '.markdownlint-cli2.jsonc') or a prefix with a supported name " +
177+
"(e.g., 'example.markdownlint-cli2.jsonc')."
177178
);
178179
}
179180
} catch (error) {

test/markdownlint-cli2-test-cases.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ const testCases = ({
722722
"args": [ "--config", "cfg/unrecognized.jsonc", "**/*.md" ],
723723
"exitCode": 2,
724724
"stderrRe":
725-
/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,
725+
/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,
726726
"cwd": "config-files"
727727
});
728728

0 commit comments

Comments
 (0)