Skip to content

Commit 1ce32d6

Browse files
authored
Add .markdownlint.jsonc to list of automatically-used configuration files (with highest precedence for consistency with markdownlint-cli2) (fixes #290).
1 parent 2eba8d0 commit 1ce32d6

File tree

11 files changed

+36
-3
lines changed

11 files changed

+36
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ A sample configuration file:
102102
For more examples, see [.markdownlint.jsonc][markdownlint-jsonc], [.markdownlint.yaml][markdownlint-yaml], or the [style folder][style-folder].
103103

104104
The CLI argument `--config` is not required.
105-
If it is not provided, `markdownlint-cli` looks for the file `.markdownlint.json`/`.markdownlint.yaml`/`.markdownlint.yml` in current folder, or for the file `.markdownlintrc` in the current or all parent folders.
105+
If it is not provided, `markdownlint-cli` looks for the file `.markdownlint.jsonc`/`.markdownlint.json`/`.markdownlint.yaml`/`.markdownlint.yml` in current folder, or for the file `.markdownlintrc` in the current or all parent folders.
106106
The algorithm is described in detail on the [`rc` package page][rc-standards].
107107
If the `--config` argument is provided, the file must be valid JSON, JSONC, JS, or YAML.
108108
JS configuration files contain JavaScript code, must have the `.js` or `.cjs` file extension, and must export (via `module.exports = ...`) a configuration object of the form shown above.

markdownlint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const exitCodes = {
3535
unexpectedError: 4
3636
};
3737

38-
const projectConfigFiles = ['.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml'];
38+
const projectConfigFiles = ['.markdownlint.jsonc', '.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml'];
3939
const configFileParsers = [jsoncParse, jsYamlSafeLoad];
4040
const fsOptions = {encoding: 'utf8'};
4141
const processCwd = process.cwd();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Heading$
2+
3+
Text
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"no-trailing-punctuation": {
3+
"punctuation": "!"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"no-trailing-punctuation": {
3+
"punctuation": "$"
4+
}
5+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
no-trailing-punctuation:
2+
punctuation: "!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
no-trailing-punctuation:
2+
punctuation: "!"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Heading$
2+
3+
Text
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// Inline comment
3+
"no-trailing-punctuation": {
4+
/*
5+
* Block comment
6+
*/
7+
"punctuation": "$"
8+
}
9+
}

0 commit comments

Comments
 (0)