Skip to content

Conversation

@pkuczynski
Copy link
Collaborator

@pkuczynski pkuczynski commented Sep 24, 2025

Description of change

There is quite a lot of inconsistency and missing jsdoc entries. I think it's worth to add eslint plugin now, so they will surface in the PRs and get fixed when new changes are introduced.

Longer run we could also generate docosaurus documentation out of it, like for example @faker/faker-js is doing...

Here is some documentation on the available rules: https://github.com/gajus/eslint-plugin-jsdoc#rules

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change

Summary by CodeRabbit

  • Chores
    • Updated linting to enforce JSDoc rules alongside existing TypeScript ESLint settings.
    • Applied JSDoc-focused linting to TypeScript source files with a recommended configuration.
    • Added the JSDoc ESLint plugin to project dependencies to improve documentation consistency.
    • No user-facing changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Adds eslint-plugin-jsdoc to the project and integrates a jsdoc plugin block into the ESLint flat config, targeting src/**/*.ts with the flat/recommended-typescript preset; also adds the package to package.json.

Changes

Cohort / File(s) Summary
ESLint configuration
eslint.config.mjs
Imports jsdoc from eslint-plugin-jsdoc and appends a plugin configuration block: jsdoc({ config: 'flat/recommended-typescript', files: ["src/**/*.ts"] }). Keeps existing TypeScript ESLint rule sets intact.
Package management
package.json
Adds eslint-plugin-jsdoc@^60.3.0 (appears in dependencies and devDependencies).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through code with eager paws,
New JSDoc rules without a pause,
Types and comments now aligned,
Neat little notes for teams to find.
A carrot-lined linting cause.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely describes the primary change of adding the jsdoc ESLint plugin in CI with warnings only, matching the modifications in both configuration and dependencies without unnecessary detail or noise.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 213edfb and 105156f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • eslint.config.mjs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • eslint.config.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: tests-linux (18) / sqljs
  • GitHub Check: tests-linux (20) / mssql
  • GitHub Check: tests-linux (20) / mongodb
  • GitHub Check: tests-linux (20) / cockroachdb
  • GitHub Check: tests-linux (20) / sap
  • GitHub Check: tests-linux (20) / sqljs
  • GitHub Check: tests-linux (20) / mysql_mariadb
  • GitHub Check: tests-linux (20) / postgres (17)
  • GitHub Check: tests-linux (20) / postgres (14)
  • GitHub Check: tests-linux (20) / oracle
  • GitHub Check: tests-linux (20) / mysql_mariadb_latest
  • GitHub Check: tests-windows / sqljs
  • GitHub Check: tests-windows / sqlite
  • GitHub Check: tests-windows / better-sqlite3
  • GitHub Check: Analyze (javascript-typescript)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4f7b44 and 213edfb.

📒 Files selected for processing (2)
  • eslint.config.mjs (4 hunks)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
eslint.config.mjs (3)

2-2: Correct import pattern for the jsdoc plugin.

The import syntax aligns with the plugin's recommended flat config pattern and matches the dependency added in package.json.


31-31: ESLint configuration property access is correct.

The property access tseslint.configs.recommendedTypeChecked is correctly used for extending the TypeScript ESLint recommended configuration.


86-89: JSDoc plugin configuration follows recommended pattern with appropriate severity level.

The configuration uses the flat config pattern as recommended by the plugin documentation. The flat/recommended-typescript preset is appropriate for TypeScript projects, and starting with warnings (instead of errors) is a sensible approach for initial rollout. The comment about switching to flat/recommended-typescript-error later provides clear next steps.

The files pattern correctly targets only source TypeScript files (src/**/*.ts), avoiding unnecessary linting of test files, build outputs, or configuration files.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

LGTM 👏
Thanks @pkuczynski

@gioboa gioboa requested review from alumni and naorpeled September 24, 2025 13:03
@alumni
Copy link
Collaborator

alumni commented Sep 24, 2025

Thanks for the contribution!

Please fix the lockfile issues (needs to be generated using npm@10) and the formatting of eslint.config.mjs (prettier setting: "trailingComma": "all").

@pkuczynski
Copy link
Collaborator Author

Both fixed. Would you mind giving it another look?

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 25, 2025

typeorm-sql-js-example

npm i https://pkg.pr.new/typeorm/typeorm@11681

commit: 105156f

@coveralls
Copy link

Coverage Status

coverage: 76.427%. first build
when pulling 105156f on pkuczynski:jsdoc
into 83e3a8a on typeorm:master.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alumni alumni merged commit e0e7de1 into typeorm:master Sep 26, 2025
62 checks passed
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
* ci: introduce jsdoc eslint plugin (warnings only)

* fixed

* fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants