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
[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]>
  • Loading branch information
cjihrig authored and danielleadams committed Mar 16, 2021
1 parent 7a1de1f commit 25a5f0b
Show file tree
Hide file tree
Showing 15 changed files with 332 additions and 373 deletions.
16 changes: 10 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ module.exports = {
overrides: [
{
files: [
'doc/api/esm.md',
'doc/api/fs.md',
'doc/api/module.md',
'doc/api/modules.md',
'doc/api/packages.md',
'doc/api/wasi.md',
'doc/api/esm.md/*.js',
'doc/api/fs.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 @@ -68,6 +68,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
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,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 @@ -1220,8 +1220,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 @@ -1234,7 +1232,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
Loading

0 comments on commit 25a5f0b

Please sign in to comment.