Skip to content

Commit

Permalink
tools: re-implement lint-md without unified-args
Browse files Browse the repository at this point in the history
`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]>
  • Loading branch information
Trott authored and targos committed Oct 4, 2021
1 parent 6489423 commit 67812e8
Show file tree
Hide file tree
Showing 15 changed files with 22,658 additions and 51,162 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ test/addons/??_*
test/fixtures
test/message/esm_display_syntax_error.mjs
tools/icu
tools/lint-md.mjs
tools/node-lint-md-cli-rollup/dist
tools/lint-md/lint-md.mjs
benchmark/tmp
doc/**/*.js
!.eslintrc.js
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Get release version numbers
if: ${{ github.event.pull_request && github.event.pull_request.base.ref == github.event.pull_request.base.repo.default_branch }}
id: get-released-versions
run: ./tools/node-lint-md-cli-rollup/src/list-released-versions-from-changelogs.mjs
run: ./tools/lint-md/list-released-versions-from-changelogs.mjs
- name: Lint docs
run: |
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1221,12 +1221,11 @@ bench-addons-clean:
.PHONY: lint-md-rollup
lint-md-rollup:
$(RM) tools/.*mdlintstamp
cd tools/node-lint-md-cli-rollup && npm install
cd tools/node-lint-md-cli-rollup && npm run build-node
cd tools/lint-md && npm ci && npm run build

.PHONY: lint-md-clean
lint-md-clean:
$(RM) -r tools/node-lint-md-cli-rollup/node_modules
$(RM) -r tools/lint-md/node_modules
$(RM) tools/.*mdlintstamp

.PHONY: lint-md-build
Expand All @@ -1243,7 +1242,7 @@ LINT_MD_TARGETS = doc src lib benchmark test tools/doc tools/icu $(wildcard *.md
LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \
$(LINT_MD_NEWER))
run-lint-md = tools/lint-md.mjs -q -f --no-stdout $(LINT_MD_FILES)
run-lint-md = tools/lint-md/lint-md.mjs $(LINT_MD_FILES)
# Lint all changed markdown files maintained by us
tools/.mdlintstamp: $(LINT_MD_FILES)
$(info Running Markdown linter...)
Expand Down
1 change: 1 addition & 0 deletions tools/lint-md/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading

0 comments on commit 67812e8

Please sign in to comment.