Skip to content

Commit 934d3f0

Browse files
committed
tools: update eslint-plugin-markdown configuration
This commit updates the linting setup to work with [email protected]. This also allows the update-eslint script to continue to function properly without changes. PR-URL: #37549 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent f6b1df2 commit 934d3f0

File tree

15 files changed

+332
-373
lines changed

15 files changed

+332
-373
lines changed

.eslintrc.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ module.exports = {
5353
overrides: [
5454
{
5555
files: [
56-
'doc/api/esm.md',
57-
'doc/api/fs.md',
58-
'doc/api/module.md',
59-
'doc/api/modules.md',
60-
'doc/api/packages.md',
61-
'doc/api/wasi.md',
56+
'doc/api/esm.md/*.js',
57+
'doc/api/fs.md/*.js',
58+
'doc/api/module.md/*.js',
59+
'doc/api/modules.md/*.js',
60+
'doc/api/packages.md/*.js',
61+
'doc/api/wasi.md/*.js',
6262
'test/es-module/test-esm-type-flag.js',
6363
'test/es-module/test-esm-type-flag-alias.js',
6464
'*.mjs',
@@ -68,6 +68,10 @@ module.exports = {
6868
},
6969
{
7070
files: ['**/*.md'],
71+
processor: 'markdown/markdown',
72+
},
73+
{
74+
files: ['**/*.md/*.js'],
7175
parserOptions: { ecmaFeatures: { impliedStrict: true } },
7276
rules: { strict: 'off' },
7377
},

Makefile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ lint-md: lint-js-doc | tools/.mdlintstamp
12091209
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools
12101210

12111211
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
1212-
--report-unused-disable-directives --ext=$(EXTENSIONS) $(LINT_JS_TARGETS)
1212+
--report-unused-disable-directives $(LINT_JS_TARGETS)
12131213
run-lint-js-fix = $(run-lint-js) --fix
12141214

12151215
.PHONY: lint-js-fix
@@ -1220,8 +1220,6 @@ lint-js-fix:
12201220
.PHONY: lint-js-doc
12211221
# Note that on the CI `lint-js-ci` is run instead.
12221222
# Lints the JavaScript code with eslint.
1223-
lint-js lint-js-fix: EXTENSIONS=.js,.mjs,.md
1224-
lint-js-doc: EXTENSIONS=.md
12251223
lint-js lint-js-doc:
12261224
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
12271225
echo "Skipping $@ (no crypto)"; \
@@ -1234,7 +1232,7 @@ jslint: lint-js
12341232
$(warning Please use lint-js instead of jslint)
12351233

12361234
run-lint-js-ci = tools/node_modules/eslint/bin/eslint.js \
1237-
--report-unused-disable-directives --ext=.js,.mjs,.md -f tap \
1235+
--report-unused-disable-directives -f tap \
12381236
-o test-eslint.tap $(LINT_JS_TARGETS)
12391237

12401238
.PHONY: lint-js-ci

0 commit comments

Comments
 (0)