Skip to content

Commit eeb8ce3

Browse files
committed
chore(lint): remove
1 parent 53b457d commit eeb8ce3

37 files changed

+19
-1861
lines changed

.github/workflows/generate.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ jobs:
7777
-t ${{ matrix.target }} \
7878
-i "${{ matrix.input }}" \
7979
-o "out/${{ matrix.target }}" \
80-
--index ./node/doc/api/index.md \
81-
--skip-lint
80+
--index ./node/doc/api/index.md
8281
8382
- name: Upload ${{ matrix.target }} artifacts
8483
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

README.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,14 @@ $ npx doc-kit --help
3838
```
3939
Usage: @nodejs/doc-kit [options] [command]
4040
41-
CLI tool to generate and lint Node.js API documentation
41+
CLI tool to generate the Node.js API documentation
4242
4343
Options:
4444
-h, --help display help for command
4545
4646
Commands:
4747
generate [options] Generate API docs
48-
lint [options] Run linter independently
4948
interactive Launch guided CLI wizard
50-
list <types> List the given type
5149
help [command] display help for command
5250
```
5351

@@ -67,23 +65,6 @@ Options:
6765
-c, --changelog <url> Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
6866
--git-ref <url> Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
6967
-t, --target [modes...] Target generator modes (choices: "json-simple", "legacy-html", "legacy-html-all", "man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db", "llms-txt")
70-
--no-lint Skip lint before generate
71-
-h, --help display help for command
72-
```
73-
74-
### `lint`
75-
76-
```
77-
Usage: @nodejs/doc-kit lint [options]
78-
79-
Run linter independently
80-
81-
Options:
82-
-i, --input <patterns...> Input file patterns (glob)
83-
--ignore [patterns...] Ignore patterns (comma-separated)
84-
--disable-rule [rules...] Disable linter rules (choices: "duplicate-stability-nodes", "invalid-change-version", "missing-introduced-in")
85-
--dry-run Dry run mode (default: false)
86-
-r, --reporter <reporter> Linter reporter to use
8768
-h, --help display help for command
8869
```
8970

@@ -97,17 +78,3 @@ Launch guided CLI wizard
9778
Options:
9879
-h, --help display help for command
9980
```
100-
101-
### `list`
102-
103-
```
104-
Usage: @nodejs/doc-kit list [options] <types>
105-
106-
List the given type
107-
108-
Arguments:
109-
types The type to list (choices: "generators", "rules", "reporters")
110-
111-
Options:
112-
-h, --help display help for command
113-
```

bin/cli.mjs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
import process from 'node:process';
44

5-
import { Argument, Command, Option } from 'commander';
5+
import { Command, Option } from 'commander';
66

77
import commands from './commands/index.mjs';
88
import interactive from './commands/interactive.mjs';
9-
import list, { types } from './commands/list.mjs';
109
import { errorWrap } from './utils.mjs';
1110

1211
const program = new Command()
1312
.name('@nodejs/doc-kit')
14-
.description('CLI tool to generate and lint Node.js API documentation');
13+
.description('CLI tool to generate the Node.js API documentation');
1514

16-
// Registering generate and lint commands
15+
// Registering commands
1716
commands.forEach(({ name, description, options, action }) => {
1817
const cmd = program.command(name).description(description);
1918

@@ -44,12 +43,5 @@ program
4443
.description('Launch guided CLI wizard')
4544
.action(errorWrap(interactive));
4645

47-
// Register the list command
48-
program
49-
.command('list')
50-
.addArgument(new Argument('<types>', 'The type to list').choices(types))
51-
.description('List the given type')
52-
.action(errorWrap(list));
53-
5446
// Parse and execute command-line arguments
5547
program.parse(process.argv);

bin/commands/generate.mjs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
} from '../../src/constants.mjs';
1010
import { publicGenerators } from '../../src/generators/index.mjs';
1111
import createGenerator from '../../src/generators.mjs';
12-
import createLinter from '../../src/linter/index.mjs';
13-
import { getEnabledRules } from '../../src/linter/utils/rules.mjs';
1412
import { parseChangelog, parseIndex } from '../../src/parsers/markdown.mjs';
1513
import { loadAndParse } from '../utils.mjs';
1614

@@ -25,7 +23,6 @@ const availableGenerators = Object.keys(publicGenerators);
2523
* @property {string} changelog - Specifies the path to the Node.js CHANGELOG.md file.
2624
* @property {string} [gitRef] - Git ref/commit URL.
2725
* @property {number} [threads] - Number of threads to allow.
28-
* @property {boolean} [skipLint] - Skip lint before generate.
2926
*/
3027

3128
/**
@@ -115,34 +112,14 @@ export default {
115112
type: 'text',
116113
},
117114
},
118-
skipLint: {
119-
flags: ['--skip-lint'],
120-
desc: 'Skip lint before generate',
121-
prompt: {
122-
type: 'confirm',
123-
message: 'Skip lint before generate?',
124-
initialValue: false,
125-
},
126-
},
127115
},
128116
/**
129117
* Handles the action for generating API docs
130118
* @param {Options} opts - The options to generate API docs.
131119
* @returns {Promise<void>}
132120
*/
133121
async action(opts) {
134-
const rules = getEnabledRules(opts.disableRule);
135-
const linter = opts.skipLint ? undefined : createLinter(rules);
136-
137-
const docs = await loadAndParse(opts.input, opts.ignore, linter);
138-
139-
linter?.report();
140-
141-
if (linter?.hasError()) {
142-
console.error('Lint failed; aborting generation.');
143-
process.exit(1);
144-
}
145-
122+
const docs = await loadAndParse(opts.input, opts.ignore);
146123
const releases = await parseChangelog(opts.changelog);
147124
const index = opts.index && (await parseIndex(opts.index));
148125

bin/commands/index.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import generate from './generate.mjs';
2-
import lint from './lint.mjs';
32

4-
export default [generate, lint];
3+
export default [generate];

bin/commands/lint.mjs

Lines changed: 0 additions & 96 deletions
This file was deleted.

bin/commands/list.mjs

Lines changed: 0 additions & 27 deletions
This file was deleted.

bin/utils.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ const parser = lazy(createMarkdownParser);
2323
* Load and parse markdown API docs.
2424
* @param {string[]} input - Glob patterns for input files.
2525
* @param {string[]} [ignore] - Glob patterns to ignore.
26-
* @param {import('../src/linter/types').Linter} [linter] - Linter instance
2726
* @returns {Promise<Array<ParserOutput<import('mdast').Root>>>}
2827
*/
29-
export async function loadAndParse(input, ignore, linter) {
28+
export async function loadAndParse(input, ignore) {
3029
const files = await loader().loadFiles(input, ignore);
31-
return parser(linter).parseApiDocs(files);
30+
return parser().parseApiDocs(files);
3231
}
3332

3433
/**
@@ -49,7 +48,7 @@ export const errorWrap =
4948
};
5049

5150
/**
52-
* Represents a command-line option for the linter CLI.
51+
* Represents a command-line option for the CLI.
5352
* @typedef {Object} Option
5453
* @property {string[]} flags - Command-line flags, e.g., ['-i, --input <patterns...>'].
5554
* @property {string} desc - Description of the option.

0 commit comments

Comments
 (0)