Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: enable jsdoc recommended rules #41057

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ Module._findPath = (request, paths, isMain) => {

module.exports = {
root: true,
extends: ['plugin:jsdoc/recommended'],
plugins: ['jsdoc', 'markdown', 'node-core'],
parser: '@babel/eslint-parser',
parserOptions: {
@@ -338,7 +339,21 @@ module.exports = {
'valid-typeof': ['error', { requireStringLiterals: true }],

// JSDoc rules
'jsdoc/check-types': 'error',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/valid-types': 'off',
'jsdoc/no-undefined-types': 'off',
'jsdoc/require-param': 'off',
'jsdoc/check-tag-names': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/check-param-names': 'off',
'jsdoc/tag-lines': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/check-alignment': 'off',
'jsdoc/require-returns-check': 'off',

// Custom rules from eslint-plugin-node-core
'node-core/no-unescaped-regexp-dot': 'error',
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1268,7 +1268,7 @@ format-md:
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 $(LINT_JS_TARGETS)
--max-warnings=0 --report-unused-disable-directives $(LINT_JS_TARGETS)
run-lint-js-fix = $(run-lint-js) --fix

.PHONY: lint-js-fix
@@ -1292,7 +1292,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 -f tap \
--max-warnings=0 --report-unused-disable-directives -f tap \
-o test-eslint.tap $(LINT_JS_TARGETS)

.PHONY: lint-js-ci
2 changes: 1 addition & 1 deletion test/common/wpt.js
Original file line number Diff line number Diff line change
@@ -323,7 +323,7 @@ class WPTRunner {

/**
* Set the scripts modifier for each script.
* @param {(meta: { code: string, filename: string }) => void}
* @param {(meta: { code: string, filename: string }) => void} modifier
*/
setScriptModifier(modifier) {
this.scriptsModifier = modifier;
2 changes: 1 addition & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
@@ -699,7 +699,7 @@ goto lint-js
if not defined lint_js goto lint-md-build
if not exist tools\node_modules\eslint goto no-lint
echo running lint-js
%node_exe% tools\node_modules\eslint\bin\eslint.js --cache --report-unused-disable-directives --rule "linebreak-style: 0" .eslintrc.js benchmark doc lib test tools
%node_exe% tools\node_modules\eslint\bin\eslint.js --cache --max-warnings=0 --report-unused-disable-directives --rule "linebreak-style: 0" .eslintrc.js benchmark doc lib test tools
goto lint-md-build

:no-lint