Skip to content

Conversation

@MattDevy
Copy link
Contributor

@MattDevy MattDevy commented Nov 14, 2025

I would advise viewing this PR per-commit, as commit 2 is pretty large!


Commits:

  1. Adds the eslint rule to validate the JSDocs of endpoints
    a. Includes a fixer
  2. Runs npm run lint --prefix specification -- --fix to fix existing JSDocs that violate the rules outlined in JSDoc endpoint comments should be explicitly split in summary and description #2757

Example output:

npm run lint --prefix specification -- --fix

> specification@0.1.0 lint
> eslint --fix


/Users/mdevy/Documents/Github/elasticsearch-specification/specification/_global/bulk/BulkRequest.ts
   51:1  error  Markdown error (MD040/fenced-code-language): Fenced code blocks should have a language specified  es-spec-validator/jsdoc-endpoint-check
   90:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  102:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  107:1  error  Markdown error (MD040/fenced-code-language): Fenced code blocks should have a language specified  es-spec-validator/jsdoc-endpoint-check
  115:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  120:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  126:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  133:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  137:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check

/Users/mdevy/Documents/Github/elasticsearch-specification/specification/_global/create/CreateRequest.ts
  47:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading  es-spec-validator/jsdoc-endpoint-check
  67:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading  es-spec-validator/jsdoc-endpoint-check
  78:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading  es-spec-validator/jsdoc-endpoint-check
  83:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading  es-spec-validator/jsdoc-endpoint-check

/Users/mdevy/Documents/Github/elasticsearch-specification/specification/_global/delete/DeleteRequest.ts
  42:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  47:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  55:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check
  63:1  error  Markdown error (MD040/fenced-code-language): Fenced code blocks should have a language specified  es-spec-validator/jsdoc-endpoint-check
  70:1  error  Markdown error (MD036/no-emphasis-as-heading): Emphasis used instead of a heading                 es-spec-validator/jsdoc-endpoint-check

// ...

✖ 219 problems (219 errors, 0 warnings)
Screenshot 2025-11-14 at 15 07 52

Outstanding Questions

  1. What do we do about the existing markdown errors within the JSDocs?
  2. Which branches will need this backporting?

@github-actions
Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

@MattDevy MattDevy force-pushed the chore/jsdoc-endpoints branch from d6b8ca7 to 84997d3 Compare November 14, 2025 14:33
@MattDevy MattDevy force-pushed the chore/jsdoc-endpoints branch from 84997d3 to b3e4e66 Compare November 14, 2025 14:35
@MattDevy MattDevy marked this pull request as ready for review November 14, 2025 17:40
@MattDevy MattDevy requested review from a team as code owners November 14, 2025 17:40
@MattDevy
Copy link
Contributor Author

@pquentin given this makes changes to the docs (added spaces), does this need backporting to 9.2, 9.1 and 8.19?

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@MattDevy MattDevy merged commit 061b56d into main Nov 17, 2025
13 of 14 checks passed
@MattDevy MattDevy deleted the chore/jsdoc-endpoints branch November 17, 2025 09:24
@github-actions
Copy link
Contributor

The backport to 9.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.1 9.1
# Navigate to the new working tree
cd .worktrees/backport-9.1
# Create a new branch
git switch --create backport-5677-to-9.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 061b56d67dd7a22590afaff094d289e7be4025de
# Push it to GitHub
git push --set-upstream origin backport-5677-to-9.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.1

Then, create a pull request where the base branch is 9.1 and the compare/head branch is backport-5677-to-9.1.

@github-actions
Copy link
Contributor

The backport to 9.2 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.2 9.2
# Navigate to the new working tree
cd .worktrees/backport-9.2
# Create a new branch
git switch --create backport-5677-to-9.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 061b56d67dd7a22590afaff094d289e7be4025de
# Push it to GitHub
git push --set-upstream origin backport-5677-to-9.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.2

Then, create a pull request where the base branch is 9.2 and the compare/head branch is backport-5677-to-9.2.

MattDevy added a commit that referenced this pull request Nov 17, 2025
* chore: add new JSDoc endpoint check rule

* chore: `npm run lint --prefix specification -- --fix`

* doc: fix missing ` in validator/README/md

* chore: prettier

* chore: disable currently failing markdown lint errors in JSDocs

(cherry picked from commit 061b56d)
MattDevy added a commit that referenced this pull request Nov 17, 2025
* chore: add new JSDoc endpoint check rule

* chore: `npm run lint --prefix specification -- --fix`

* doc: fix missing ` in validator/README/md

* chore: prettier

* chore: disable currently failing markdown lint errors in JSDocs

(cherry picked from commit 061b56d)
MattDevy added a commit that referenced this pull request Nov 19, 2025
* chore: add new JSDoc endpoint check rule (#5677)

* chore: add new JSDoc endpoint check rule

* chore: `npm run lint --prefix specification -- --fix`

* doc: fix missing ` in validator/README/md

* chore: prettier

* chore: disable currently failing markdown lint errors in JSDocs

(cherry picked from commit 061b56d)

* Delete validator/test/no-all-string-literal-unions.test.js

* Delete validator/test/no-duplicate-type-names.test.js

* Delete specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts

* fix: remove added files

* Update package-lock.json

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
MattDevy added a commit that referenced this pull request Nov 19, 2025
* chore: add new JSDoc endpoint check rule (#5677)

* chore: add new JSDoc endpoint check rule

* chore: `npm run lint --prefix specification -- --fix`

* doc: fix missing ` in validator/README/md

* chore: prettier

* chore: disable currently failing markdown lint errors in JSDocs

(cherry picked from commit 061b56d)

* Update package-lock.json

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSDoc endpoint comments should be explicitly split in summary and description

3 participants