Skip to content

Commit bf4d935

Browse files
committed
feat: create cli option
1 parent 5aeccfe commit bf4d935

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/cli.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import createMarkdownParser from '../src/parsers/markdown.mjs';
1414
import createNodeReleases from '../src/releases.mjs';
1515
import createLinter from '../src/linter/index.mjs';
1616
import reporters from '../src/linter/reporters/index.mjs';
17+
import rules from '../src/linter/rules/index.mjs';
1718

1819
const availableGenerators = Object.keys(generators);
1920

@@ -52,6 +53,11 @@ program
5253
'Set the processing target modes'
5354
).choices(availableGenerators)
5455
)
56+
.addOption(
57+
new Option('--disable-rule [rule...]', 'Disable a specific linter rule')
58+
.choices(Object.keys(rules))
59+
.default([])
60+
)
5561
.addOption(
5662
new Option('--lint-dry-run', 'Run linter in dry-run mode').default(false)
5763
)
@@ -71,6 +77,7 @@ program
7177
* @property {Target[]} target Specifies the generator target mode.
7278
* @property {string} version Specifies the target Node.js version.
7379
* @property {string} changelog Specifies the path to the Node.js CHANGELOG.md file.
80+
* @property {string[]} disableRule Specifies the linter rules to disable.
7481
* @property {boolean} lintDryRun Specifies whether the linter should run in dry-run mode.
7582
* @property {keyof reporters} reporter Specifies the linter reporter.
7683
*
@@ -84,11 +91,12 @@ const {
8491
target = [],
8592
version,
8693
changelog,
94+
disableRule,
8795
lintDryRun,
8896
reporter,
8997
} = program.opts();
9098

91-
const linter = createLinter(lintDryRun);
99+
const linter = createLinter(lintDryRun, disableRule);
92100

93101
const { loadFiles } = createMarkdownLoader();
94102
const { parseApiDocs } = createMarkdownParser();

0 commit comments

Comments
 (0)