You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,17 +36,28 @@ With shells like Bash, it may be necessary to quote globs so they are not interp
36
36
For example, `--ignore *.md` would be expanded by Bash to `--ignore a.md b.md ...` before invoking `markdownlint-cli`, causing it to ignore only the first file because `--ignore` takes a single parameter (though it can be used multiple times).
37
37
Quoting the glob like `--ignore '*.md'` passes it through unexpanded and ignores the set of files.
38
38
39
-
#### Examples
39
+
#### Globbing examples
40
40
41
41
To lint all Markdown files in a Node.js project (excluding dependencies), the following commands might be used:
42
42
43
43
Windows CMD: `markdownlint **/*.md --ignore node_modules`
44
44
45
45
Linux Bash: `markdownlint '**/*.md' --ignore node_modules`
46
46
47
+
### Ignoring files
48
+
49
+
If present in the current folder, a `.markdownlintignore` file will be used to ignore files and /or directories according to the rules for [gitignore][gitignore].
50
+
51
+
The order of operations is:
52
+
53
+
- Enumerate files/directories/globs on the command line
54
+
- Apply exclusions from `.markdownlintignore`
55
+
- Apply exclusions from `-i`/`--ignore` option(s)
56
+
47
57
### Fixing errors
48
58
49
-
When the `--fix` option is specified, `markdownlint-cli` tries to apply all fixes reported by the active rules and reports any errors that remain. Because this option makes changes to the input files, it is good to make a backup first or work with files under source control so any unwanted changes can be undone.
59
+
When the `--fix` option is specified, `markdownlint-cli` tries to apply all fixes reported by the active rules and reports any errors that remain.
60
+
Because this option makes changes to the input files, it is good to make a backup first or work with files under source control so any unwanted changes can be undone.
50
61
51
62
> Because not all rules include fix information when reporting errors, fixes may overlap, and not all errors are fixable, `--fix` will not usually address all errors.
52
63
@@ -70,12 +81,16 @@ The example of configuration file:
70
81
71
82
See [test configuration file][test-config] or [style folder][style-folder] for more examples.
72
83
73
-
CLI argument `--config` is not mandatory. If it is not provided, `markdownlint-cli` looks for file `.markdownlint.json`/`.markdownlint.yaml`/`.markdownlint.yml` in current folder, or for file `.markdownlintrc` in current or all upper folders. The algorithm is described in details on [rc package page][rc-standards]. If `--config` argument is provided, the file must be valid JSON, JSONC, or YAML.
84
+
CLI argument `--config` is not mandatory.
85
+
If it is not provided, `markdownlint-cli` looks for file `.markdownlint.json`/`.markdownlint.yaml`/`.markdownlint.yml` in current folder, or for file `.markdownlintrc` in current or all upper folders.
86
+
The algorithm is described in details on [rc package page][rc-standards].
87
+
If `--config` argument is provided, the file must be valid JSON, JSONC, or YAML.
74
88
75
89
## Related
76
90
77
91
-[markdownlint][markdownlint] - API for this module
0 commit comments