Skip to content

Commit

Permalink
Reword configuration file name exception text for clarity (fixes #481).
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Dec 23, 2024
1 parent 7b3ac50 commit 6f6d7e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions markdownlint-cli2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/markdownlint-cli2-test-cases.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
});

Expand Down

0 comments on commit 6f6d7e8

Please sign in to comment.