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
+1-1
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ JS configuration files contain JavaScript code, must have the `.js` or `.cjs` fi
113
113
If your workspace _(project)_ is [ESM-only]_(`"type": "module"` set in the root `package.json` file)_, then the configuration file **should end with `.cjs` file extension**.
114
114
A JS configuration file may internally `require` one or more npm packages as a way of reusing configuration across projects.
115
115
116
-
`--enable` and `--disable` override configuration files; if a configuration file disables `MD002` and you pass `--enable MD002`, it will be enabled.
116
+
`--enable` and `--disable` override configuration files; if a configuration file disables `MD123` and you pass `--enable MD123`, it will be enabled.
117
117
If a rule is passed to both `--enable` and `--disable`, it will be disabled.
118
118
119
119
> JS configuration files must be provided via the `--config` argument; they are not automatically loaded because running untrusted code is a security concern.
'incorrect.md:1 MD002/first-heading-h1/first-header-h1 First heading should be a top-level heading [Expected: h1; Actual: h2]',
272
-
'incorrect.md:1 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## header 2"]',
273
-
'incorrect.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]',
274
-
'incorrect.md:2 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "# header"]',
275
-
'incorrect.md:5:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]',
276
-
'incorrect.md:11:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]',
277
-
'incorrect.md:17:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]',
278
-
'incorrect.md:23:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]',
279
-
''
280
-
].join('\n');
270
+
constexpected=['incorrect.md:1 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## header 2"]','incorrect.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]','incorrect.md:2 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "# header"]','incorrect.md:5:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]','incorrect.md:11:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]','incorrect.md:17:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]','incorrect.md:23:1 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ code"]',''].join('\n');
281
271
t.is(error.stdout,'');
282
272
t.is(error.stderr,expected);
283
273
t.is(error.exitCode,1);
@@ -591,7 +581,7 @@ test('fixing errors in a file yields fewer errors', async t => {
constexpected=[fixFileA+':1 MD002/first-heading-h1/first-header-h1 First heading should be a top-level heading [Expected: h1; Actual: h2]',fixFileA+':1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]',''].join('\n');
584
+
constexpected=[fixFileA+':1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]',''].join('\n');
595
585
t.is(error.stdout,'');
596
586
t.is(error.stderr,expected);
597
587
t.is(error.exitCode,1);
@@ -607,7 +597,7 @@ test('fixing errors in a file with absolute path yields fewer errors', async t =
607
597
t.fail();
608
598
}catch(error){
609
599
t.is(error.stdout,'');
610
-
t.is(error.stderr.match(errorPattern).length,2);
600
+
t.is(error.stderr.match(errorPattern).length,1);
611
601
t.is(error.exitCode,1);
612
602
fs.unlinkSync(fixFileB);
613
603
}
@@ -624,7 +614,7 @@ test('fixing errors with a glob yields fewer errors', async t => {
624
614
t.fail();
625
615
}catch(error){
626
616
t.is(error.stdout,'');
627
-
t.is(error.stderr.match(errorPattern).length,4);
617
+
t.is(error.stderr.match(errorPattern).length,2);
628
618
t.is(error.exitCode,1);
629
619
fs.unlinkSync(fixFileC);
630
620
fs.unlinkSync(fixSubFileC);
@@ -724,7 +714,7 @@ test('--dot option to include folders/files with a dot', async t => {
724
714
t.fail();
725
715
}catch(error){
726
716
t.is(error.stdout,'');
727
-
t.is(error.stderr.match(errorPattern).length,13);
717
+
t.is(error.stderr.match(errorPattern).length,11);
728
718
t.is(error.exitCode,1);
729
719
}
730
720
});
@@ -749,11 +739,11 @@ test('with --quiet option does not print to stdout or stderr', async t => {
t.is(error.stderr,'incorrect.md:1 MD002/first-heading-h1/first-header-h1 First heading should be a top-level heading [Expected: h1; Actual: h2]\n');
746
+
t.is(error.stderr,'incorrect.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]\n');
757
747
t.is(error.exitCode,1);
758
748
}
759
749
});
@@ -764,24 +754,24 @@ test('--enable flag does not modify already enabled rules', async t => {
t.is(error.stderr,'incorrect.md:1 MD002/first-heading-h1/first-header-h1 First heading should be a top-level heading [Expected: h1; Actual: h2]\n');
768
+
t.is(error.stderr,'incorrect.md:1 MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "## header 2"]\n');
0 commit comments