Skip to content

Commit 67812e8

Browse files
Trotttargos
authored andcommitted
tools: re-implement lint-md without unified-args
`unified-args` ignores settings in the preset, expecting them to be in remarkrc files or passed on the command line instead. Realizing that we always send the same configuration options via the command-line anyway, this removes `unified-args`. This means the preset settings are now respected and it removes nearly 30000 lines of code in the resulting rollup file. I wasn't sure I was going to want to keep rollup so I started re-implementing this without it, but ended up putting a minimal rollup back as it still saves about 90000 lines of code vs. checking in `node_modules`. PR-URL: #40180 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 6489423 commit 67812e8

15 files changed

+22658
-51162
lines changed

.eslintignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ test/addons/??_*
44
test/fixtures
55
test/message/esm_display_syntax_error.mjs
66
tools/icu
7-
tools/lint-md.mjs
8-
tools/node-lint-md-cli-rollup/dist
7+
tools/lint-md/lint-md.mjs
98
benchmark/tmp
109
doc/**/*.js
1110
!.eslintrc.js

.github/workflows/linters.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Get release version numbers
5656
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
5757
id: get-released-versions
58-
run: ./tools/node-lint-md-cli-rollup/src/list-released-versions-from-changelogs.mjs
58+
run: ./tools/lint-md/list-released-versions-from-changelogs.mjs
5959
- name: Lint docs
6060
run: |
6161
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,11 @@ bench-addons-clean:
12211221
.PHONY: lint-md-rollup
12221222
lint-md-rollup:
12231223
$(RM) tools/.*mdlintstamp
1224-
cd tools/node-lint-md-cli-rollup && npm install
1225-
cd tools/node-lint-md-cli-rollup && npm run build-node
1224+
cd tools/lint-md && npm ci && npm run build
12261225

12271226
.PHONY: lint-md-clean
12281227
lint-md-clean:
1229-
$(RM) -r tools/node-lint-md-cli-rollup/node_modules
1228+
$(RM) -r tools/lint-md/node_modules
12301229
$(RM) tools/.*mdlintstamp
12311230

12321231
.PHONY: lint-md-build
@@ -1243,7 +1242,7 @@ LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(wildcard *.md
12431242
LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
12441243
! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \
12451244
$(LINT_MD_NEWER))
1246-
run-lint-md = tools/lint-md.mjs -q -f --no-stdout $(LINT_MD_FILES)
1245+
run-lint-md = tools/lint-md/lint-md.mjs $(LINT_MD_FILES)
12471246
# Lint all changed markdown files maintained by us
12481247
tools/.mdlintstamp: $(LINT_MD_FILES)
12491248
$(info Running Markdown linter...)

tools/lint-md/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)