Skip to content

Commit

Permalink
tools: update eslint-plugin-markdown configuration
Browse files Browse the repository at this point in the history
This commit updates the linting setup to work with
eslint-plugin-markdown@2.0.0. This also allows the update-eslint
script to continue to function properly without changes.

PR-URL: #37549
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Jun 11, 2021
1 parent f868fac commit 2463bd0
Show file tree
Hide file tree
Showing 15 changed files with 331 additions and 372 deletions.
14 changes: 9 additions & 5 deletions .eslintrc.js
Expand Up @@ -53,11 +53,11 @@ module.exports = {
overrides: [
{
files: [
'doc/api/esm.md',
'doc/api/module.md',
'doc/api/modules.md',
'doc/api/packages.md',
'doc/api/wasi.md',
'doc/api/esm.md/*.js',
'doc/api/module.md/*.js',
'doc/api/modules.md/*.js',
'doc/api/packages.md/*.js',
'doc/api/wasi.md/*.js',
'test/es-module/test-esm-type-flag.js',
'test/es-module/test-esm-type-flag-alias.js',
'*.mjs',
Expand All @@ -67,6 +67,10 @@ module.exports = {
},
{
files: ['**/*.md'],
processor: 'markdown/markdown',
},
{
files: ['**/*.md/*.js'],
parserOptions: { ecmaFeatures: { impliedStrict: true } },
rules: { strict: 'off' },
},
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -1222,7 +1222,7 @@ lint-md: lint-js-doc | tools/.mdlintstamp
LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools

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

.PHONY: lint-js-fix
Expand All @@ -1233,8 +1233,6 @@ lint-js-fix:
.PHONY: lint-js-doc
# Note that on the CI `lint-js-ci` is run instead.
# Lints the JavaScript code with eslint.
lint-js lint-js-fix: EXTENSIONS=.js,.mjs,.md
lint-js-doc: EXTENSIONS=.md
lint-js lint-js-doc:
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping $@ (no crypto)"; \
Expand All @@ -1247,7 +1245,7 @@ jslint: lint-js
$(warning Please use lint-js instead of jslint)

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

.PHONY: lint-js-ci
Expand Down

0 comments on commit 2463bd0

Please sign in to comment.