Skip to content

Commit

Permalink
WebUI: Add ESLint plugin for checking JSDoc
Browse files Browse the repository at this point in the history
Specifically, this adds eslint-plugin-jsdoc as dependency.

eslint-plugin-jsdoc enables more fine grained control for JSDoc linting
in ESLint. This enables ESLint to check that JSDoc are valid in
TypeScript files, since the style guide for TypeScript states that types
should not be repeated in JSDoc for TypeScript files, but the builtin
valid-jsdoc rule requires type to be present.

Also the builtin JSDoc related rules (require-jsdoc, valid-jsdoc) are
deprecated (https://eslint.org/blog/2018/11/jsdoc-end-of-life) and
ESLint officially recommends to use eslint-plugin-jsdoc.

This increases the uncompressed node_modules size by about 1.06MB, but
all those are only for developments and shouldn't affect Chrome build
size.

Bug: b:211723843
Test: Check that the plugin works with ESLint in CCA with CL:3372522.

Change-Id: I4fdcab145d03d82170f1815e354499f00bb32537
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3371546
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Pi-Hsun Shih <pihsun@chromium.org>
Auto-Submit: Pi-Hsun Shih <pihsun@chromium.org>
Cr-Commit-Position: refs/heads/main@{#956990}
  • Loading branch information
peter50216 authored and Chromium LUCI CQ committed Jan 10, 2022
1 parent adf992a commit dbbd940
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 7 deletions.
14 changes: 14 additions & 0 deletions third_party/node/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,17 @@ Universal)

Local Modifications:
(none)


Name: ESLint JSDoc Plugin
Short Name: eslint-plugin-jsdoc
URL: https://www.npmjs.com/package/eslint-plugin-jsdoc
Version: 37.5.1
License: BSD-3-Clause
Security Critical: No. The ESLint checks are not shipped with Chrome and code are only linted with it.

Description:
JSDoc linting rules for ESLint.

Local Modifications:
(none)
2 changes: 1 addition & 1 deletion third_party/node/node_modules.tar.gz.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31d731fb82ea62a6dae24d2bdfe6f0aa6164b949
1291471c9ef3dd6fca73dda7b5d0eea1026da863
169 changes: 163 additions & 6 deletions third_party/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions third_party/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"babel-eslint": "10.0.2",
"crisper": "2.1.1",
"eslint": "7.11.0",
"eslint-plugin-jsdoc": "37.5.1",
"polymer-bundler": "4.0.10",
"polymer-css-build": "0.7.0",
"rollup": "2.58.0",
Expand Down

0 comments on commit dbbd940

Please sign in to comment.