Switched to more correct JSDoc types for primitives#27430
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (79)
✅ Files skipped from review due to trivial changes (78)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis pull request standardizes JSDoc annotations across the codebase by replacing boxed type identifiers ( 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
This patch does not contain a migration. |
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
ghost/core/core/server/adapters/cache/MemoryCache.js (1)
29-29:⚠️ Potential issue | 🟡 MinorInconsistent primitive type in return annotation.
Line 29 still uses
Array<String>but should useArray<string>to be consistent with the PR's objective of replacing capitalized primitive types with lowercase equivalents.📝 Proposed fix
- * `@returns` {Array<String>} all keys present in the cache + * `@returns` {Array<string>} all keys present in the cache🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/core/server/adapters/cache/MemoryCache.js` at line 29, Update the JSDoc return type for the keys-returning method in MemoryCache.js: replace the capitalized primitive Array<String> with the lowercase Array<string> in the `@returns` annotation so it matches the PR's primitive-type convention; locate the JSDoc above the method (look for the comment containing "@returns {Array<String>} all keys present in the cache") and change that type token to "{Array<string>}".ghost/core/core/server/adapters/cache/AdapterCacheMemoryTTL.js (1)
47-47:⚠️ Potential issue | 🟡 MinorInconsistent primitive type in return annotation.
Line 47 still uses
Array<String>but should useArray<string>to be consistent with the PR's objective of replacing capitalized primitive types with lowercase equivalents.📝 Proposed fix
- * `@returns` {Array<String>} all keys present in the cache + * `@returns` {Array<string>} all keys present in the cache🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/core/server/adapters/cache/AdapterCacheMemoryTTL.js` at line 47, The JSDoc return annotation in the AdapterCacheMemoryTTL class uses the capitalized primitive type Array<String>; update the annotation to use the lowercase primitive form Array<string> (e.g., in the JSDoc for the method that documents "@returns {Array<String>} all keys present in the cache") so the return type becomes "@returns {Array<string>} all keys present in the cache" to match the PR's primitive-type conventions.ghost/core/core/server/adapters/lib/redis/AdapterCacheRedis.js (1)
274-274:⚠️ Potential issue | 🟡 MinorInconsistent primitive type in return annotation.
Line 274 still uses
Array<String>but should useArray<string>to be consistent with the PR's objective of replacing capitalized primitive types with lowercase equivalents.📝 Proposed fix
- * `@returns` {Promise<Array<String>>} all keys present in the cache + * `@returns` {Promise<Array<string>>} all keys present in the cache🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/core/server/adapters/lib/redis/AdapterCacheRedis.js` at line 274, Update the JSDoc return type in AdapterCacheRedis: replace the capitalized primitive Array<String> with the lowercase Array<string> in the `@returns` annotation for the method that returns all cache keys (the comment reading "@returns {Promise<Array<String>>} all keys present in the cache") so the return type is consistent with the project's lowercase primitive style.ghost/core/core/server/data/importer/import-manager.js (1)
141-142:⚠️ Potential issue | 🟡 MinorIncomplete migration of capitalized primitive types.
Several JSDoc annotations still use capitalized
Stringfor return types and array element types, while the PR aims to replace all capitalized primitives with lowercase forms. For consistency, these should also be changed:
- Line 141:
@param {String[]} items→@param {string[]} items- Line 142:
@returns {String}→@returns {string}- Line 151:
@param {String[]} extensions→@param {string[]} extensions- Line 153:
@returns {String}→@returns {string}- Line 164:
@param {String[]} directories→@param {string[]} directories- Line 166:
@returns {String}→@returns {string}- Line 271:
@returns {String}→@returns {string}📝 Proposed fix to complete the primitive type migration
/** * Convert items into a glob string - * `@param` {String[]} items - * `@returns` {String} + * `@param` {string[]} items + * `@returns` {string} */ getGlobPattern(items) { /** - * `@param` {String[]} extensions + * `@param` {string[]} extensions * `@param` {number} [level] - * `@returns` {String} + * `@returns` {string} */ getExtensionGlob(extensions, level) { /** * - * `@param` {String[]} directories + * `@param` {string[]} directories * `@param` {number} [level] - * `@returns` {String} + * `@returns` {string} */ getDirectoryGlob(directories, level) { /** * Get the name of the single base directory if there is one, else return an empty string * `@param` {string} directory - * `@returns` {String} + * `@returns` {string} */ getBaseDirectory(directory) {Also applies to: 151-153, 164-166, 271-271
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/core/server/data/importer/import-manager.js` around lines 141 - 142, Update the JSDoc annotations in import-manager.js to use lowercase primitive types: replace all occurrences of {String[]} with {string[]} for the parameters named items, extensions, and directories, and replace all occurrences of {String} with {string} for the corresponding `@returns` annotations (affecting the docs around the functions that accept items, extensions, directories and the return at line 271); ensure the param tags for items, extensions, directories and their associated `@returns` tags are updated consistently to lowercase `string` forms.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ghost/core/core/server/adapters/storage/LocalStorageBase.js`:
- Around line 277-281: The JSDoc above the async delete(...) method is using the
wrong param name (documents filePath) which mismatches the function signature
delete(fileName, targetDir); update the JSDoc to list the correct parameters
(e.g., `@param` {string} fileName and `@param` {string} [targetDir] or appropriate
type for targetDir) and keep the `@returns` as Promise.<*> to match the method's
return type so tooling and readers see the correct parameter names for the
delete function.
In `@ghost/core/core/server/adapters/storage/utils.js`:
- Line 59: Update the JSDoc `@returns` tag that still uses the uppercase primitive
"{Boolean}" to the lowercase "{boolean}" to match the earlier "{string}" change;
locate the JSDoc block where the previous line's type was changed from
"{String}" to "{string}" (the same comment block with the `@returns` tag) and
replace "{Boolean}" with "{boolean}" so all primitive types use lowercase.
- Line 43: Update the JSDoc return type from the uppercase primitive to the
lowercase form: change the JSDoc tag that currently reads "{Boolean}" to
"{boolean}" in the JSDoc block in core/server/adapters/storage/utils.js (the
return annotation for the utility function documented on the preceding lines) so
it matches the updated primitive style used elsewhere.
In `@ghost/core/core/server/lib/common/events.js`:
- Around line 21-23: The JSDoc for the event registration function uses an
inconsistent return type casing; update the `@returns` tag in the JSDoc comment
(the line currently reading "@returns {Boolean}") to use the lowercase primitive
"@returns {boolean}" so it matches the other parameter types and standard JSDoc
conventions in events.js and the related event/listener functions.
In `@ghost/core/core/server/services/adapter-manager/options-resolver.js`:
- Line 8: Update the JSDoc return annotation in options-resolver.js to use
lowercase primitive types: replace the uppercase `String` in the `@returns` object
for `adapterClassName` with `string` so the return annotation reads
{{adapterClassName: string, adapterConfig: Object}} (leave non-primitive
`Object` as-is or adjust similarly if following the same casing convention) to
match the PR's lowercase primitive types policy.
In
`@ghost/core/core/server/services/members/importer/members-csv-importer-stripe-utils.js`:
- Line 188: Update the JSDoc for the stripePriceId parameter in
members-csv-importer-stripe-utils.js from {number} to {string}; specifically
change the `@param` annotation for stripePriceId so it reflects Stripe price IDs
as strings (they come from newStripePrice.id and
ghostProductPrice.get('stripe_price_id')), ensuring correct TypeScript/JSDoc
type inference for any functions that accept stripePriceId.
In `@ghost/core/core/server/services/oembed/oembed-service.js`:
- Line 149: Update the JSDoc `@returns` type in the oembed-service.js JSDoc block
from uppercase "String" to lowercase "string" to match the parameter types
already updated on the same docblock; edit the `@returns` line for the method
documented there so the return type is "string" for consistency.
In `@ghost/core/core/server/services/settings/settings-utils.js`:
- Line 13: Update the JSDoc primitive type annotations in settings-utils.js so
they use lowercase primitives: change the `@returns` {Boolean} annotation to
`@returns` {boolean} and any `@type/`@param/@returns occurrences that use {String}
to {string} (the comment referenced around line 39). Locate the JSDoc blocks in
the file (the one with `@returns` {Boolean} and the one around line 39) and
replace the capitalized primitive types with the lowercase equivalents to match
the rest of the file.
In `@ghost/core/core/server/web/api/middleware/upload.js`:
- Line 171: Replace the primitive-type `String` in JSDoc `@returns` annotations
with lowercase `string` so the signatures read `@returns {Promise<string |
null>}` (and similarly for the other two occurrences that currently use
`String`) to match the `@param` annotations and complete the primitive-type
migration.
In `@ghost/core/test/utils/db-utils.js`:
- Line 43: Fix the JSDoc typo in the db-utils.js comment: update the description
for the options.truncate parameter (currently reads "whether to truncate rather
thann fully reset") to correct "thann" to "than" so it reads "whether to
truncate rather than fully reset" in the JSDoc block near the options.truncate
documentation.
---
Outside diff comments:
In `@ghost/core/core/server/adapters/cache/AdapterCacheMemoryTTL.js`:
- Line 47: The JSDoc return annotation in the AdapterCacheMemoryTTL class uses
the capitalized primitive type Array<String>; update the annotation to use the
lowercase primitive form Array<string> (e.g., in the JSDoc for the method that
documents "@returns {Array<String>} all keys present in the cache") so the
return type becomes "@returns {Array<string>} all keys present in the cache" to
match the PR's primitive-type conventions.
In `@ghost/core/core/server/adapters/cache/MemoryCache.js`:
- Line 29: Update the JSDoc return type for the keys-returning method in
MemoryCache.js: replace the capitalized primitive Array<String> with the
lowercase Array<string> in the `@returns` annotation so it matches the PR's
primitive-type convention; locate the JSDoc above the method (look for the
comment containing "@returns {Array<String>} all keys present in the cache") and
change that type token to "{Array<string>}".
In `@ghost/core/core/server/adapters/lib/redis/AdapterCacheRedis.js`:
- Line 274: Update the JSDoc return type in AdapterCacheRedis: replace the
capitalized primitive Array<String> with the lowercase Array<string> in the
`@returns` annotation for the method that returns all cache keys (the comment
reading "@returns {Promise<Array<String>>} all keys present in the cache") so
the return type is consistent with the project's lowercase primitive style.
In `@ghost/core/core/server/data/importer/import-manager.js`:
- Around line 141-142: Update the JSDoc annotations in import-manager.js to use
lowercase primitive types: replace all occurrences of {String[]} with {string[]}
for the parameters named items, extensions, and directories, and replace all
occurrences of {String} with {string} for the corresponding `@returns` annotations
(affecting the docs around the functions that accept items, extensions,
directories and the return at line 271); ensure the param tags for items,
extensions, directories and their associated `@returns` tags are updated
consistently to lowercase `string` forms.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: caf33018-5d08-467f-bfa5-cc3b1d08a765
📒 Files selected for processing (77)
ghost/admin/app/utils/currency.jsghost/admin/app/validators/mixins/password.jsghost/core/core/boot.jsghost/core/core/frontend/helpers/collection.jsghost/core/core/frontend/helpers/get.jsghost/core/core/frontend/helpers/has.jsghost/core/core/frontend/services/data/entry-lookup.jsghost/core/core/frontend/services/data/fetch-data.jsghost/core/core/frontend/services/rendering/templates.jsghost/core/core/frontend/services/routing/middleware/page-param.jsghost/core/core/frontend/services/routing/parent-router.jsghost/core/core/frontend/services/routing/registry.jsghost/core/core/frontend/services/sitemap/base-site-map-generator.jsghost/core/core/frontend/services/theme-engine/i18n/i18n.jsghost/core/core/frontend/services/theme-engine/i18n/theme-i18n.jsghost/core/core/server/adapters/cache/AdapterCacheMemoryTTL.jsghost/core/core/server/adapters/cache/MemoryCache.jsghost/core/core/server/adapters/lib/redis/AdapterCacheRedis.jsghost/core/core/server/adapters/scheduling/scheduling-default.jsghost/core/core/server/adapters/storage/LocalStorageBase.jsghost/core/core/server/adapters/storage/utils.jsghost/core/core/server/api/endpoints/utils/serializers/output/settings.jsghost/core/core/server/data/importer/import-manager.jsghost/core/core/server/data/importer/importers/content-file-importer.jsghost/core/core/server/data/schema/commands.jsghost/core/core/server/data/schema/fixtures/fixture-manager.jsghost/core/core/server/ghost-server.jsghost/core/core/server/lib/common/events.jsghost/core/core/server/lib/validate-password.jsghost/core/core/server/models/base/plugins/generate-slug.jsghost/core/core/server/models/base/plugins/sanitize.jsghost/core/core/server/models/comment.jsghost/core/core/server/models/member.jsghost/core/core/server/models/newsletter.jsghost/core/core/server/models/post.jsghost/core/core/server/models/role.jsghost/core/core/server/models/user.jsghost/core/core/server/services/adapter-manager/index.jsghost/core/core/server/services/adapter-manager/options-resolver.jsghost/core/core/server/services/custom-redirects/custom-redirects-api.jsghost/core/core/server/services/custom-redirects/validation.jsghost/core/core/server/services/email-analytics/email-analytics-provider-mailgun.jsghost/core/core/server/services/lib/mailgun-client.jsghost/core/core/server/services/link-redirection/link-redirect-repository.jsghost/core/core/server/services/members/importer/members-csv-importer-stripe-utils.jsghost/core/core/server/services/members/importer/members-csv-importer.jsghost/core/core/server/services/members/members-api/repositories/member-repository.jsghost/core/core/server/services/members/stats/members-stats.jsghost/core/core/server/services/oembed/oembed-service.jsghost/core/core/server/services/posts/post-email-handler.jsghost/core/core/server/services/posts/post-scheduling-service.jsghost/core/core/server/services/route-settings/default-settings-manager.jsghost/core/core/server/services/route-settings/route-settings.jsghost/core/core/server/services/route-settings/settings-loader.jsghost/core/core/server/services/route-settings/settings-path-manager.jsghost/core/core/server/services/route-settings/yaml-parser.jsghost/core/core/server/services/settings/settings-bread-service.jsghost/core/core/server/services/settings/settings-utils.jsghost/core/core/server/services/themes/installer.jsghost/core/core/server/services/themes/theme-storage.jsghost/core/core/server/services/update-check/index.jsghost/core/core/server/services/url/local-file-cache.jsghost/core/core/server/services/url/resources.jsghost/core/core/server/services/url/url-generator.jsghost/core/core/server/services/url/url-service.jsghost/core/core/server/services/url/urls.jsghost/core/core/server/web/api/middleware/upload.jsghost/core/core/shared/express.jsghost/core/test/unit/server/services/members/importer/members-csv-importer-stripe-utils.test.jsghost/core/test/utils/agents/admin-api-test-agent.jsghost/core/test/utils/agents/content-api-test-agent.jsghost/core/test/utils/agents/ghost-api-test-agent.jsghost/core/test/utils/agents/members-api-test-agent.jsghost/core/test/utils/agents/test-agent.jsghost/core/test/utils/db-utils.jsghost/core/test/utils/e2e-framework.jsghost/core/test/utils/e2e-utils.js
| /** | ||
| * @param {String} filePath | ||
| * @param {string} filePath | ||
| * @returns {Promise.<*>} | ||
| */ | ||
| async delete(fileName, targetDir) { |
There was a problem hiding this comment.
Fix JSDoc param name mismatch for delete.
Line 278 documents filePath, but the method signature is delete(fileName, targetDir). This can mislead tooling and readers.
Suggested doc fix
/**
- * `@param` {string} filePath
+ * `@param` {string} fileName
+ * `@param` {string} [targetDir]
* `@returns` {Promise.<*>}
*/
async delete(fileName, targetDir) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /** | |
| * @param {String} filePath | |
| * @param {string} filePath | |
| * @returns {Promise.<*>} | |
| */ | |
| async delete(fileName, targetDir) { | |
| /** | |
| * `@param` {string} fileName | |
| * `@param` {string} [targetDir] | |
| * `@returns` {Promise.<*>} | |
| */ | |
| async delete(fileName, targetDir) { |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/core/server/adapters/storage/LocalStorageBase.js` around lines 277
- 281, The JSDoc above the async delete(...) method is using the wrong param
name (documents filePath) which mismatches the function signature
delete(fileName, targetDir); update the JSDoc to list the correct parameters
(e.g., `@param` {string} fileName and `@param` {string} [targetDir] or appropriate
type for targetDir) and keep the `@returns` as Promise.<*> to match the method's
return type so tooling and readers see the correct parameter names for the
delete function.
| * @param {string} name | ||
| * @param {Object} adapterServiceConfig | ||
| * | ||
| * @returns {{adapterClassName: String, adapterConfig: Object}} |
There was a problem hiding this comment.
Inconsistent JSDoc type casing in return annotation.
The return type annotation still uses uppercase String for the adapterClassName property. This is inconsistent with the PR's objective to replace all uppercase primitive types with lowercase equivalents.
📝 Proposed fix
- * `@returns` {{adapterClassName: String, adapterConfig: Object}}
+ * `@returns` {{adapterClassName: string, adapterConfig: Object}} 📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * @returns {{adapterClassName: String, adapterConfig: Object}} | |
| * `@returns` {{adapterClassName: string, adapterConfig: Object}} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/core/server/services/adapter-manager/options-resolver.js` at line
8, Update the JSDoc return annotation in options-resolver.js to use lowercase
primitive types: replace the uppercase `String` in the `@returns` object for
`adapterClassName` with `string` so the return annotation reads
{{adapterClassName: string, adapterConfig: Object}} (leave non-primitive
`Object` as-is or adjust similarly if following the same casing convention) to
match the PR's lowercase primitive types policy.
| * Archive a price in Stripe | ||
| * | ||
| * @param {Number} stripePriceId | ||
| * @param {number} stripePriceId |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, check if the file exists and read the relevant section
cat -n ghost/core/core/server/services/members/importer/members-csv-importer-stripe-utils.js | sed -n '180,200p'Repository: TryGhost/Ghost
Length of output: 492
🏁 Script executed:
# Search for stripePriceId usage and how it's passed/received
rg -A 5 -B 5 "stripePriceId" ghost/core/core/server/services/members/importer/members-csv-importer-stripe-utils.jsRepository: TryGhost/Ghost
Length of output: 1877
🏁 Script executed:
# Search for Stripe price patterns to understand typical types
rg "price_" ghost/core/core/server/services/members/importer/ | head -20Repository: TryGhost/Ghost
Length of output: 213
stripePriceId JSDoc type should be {string}, not {number}.
Stripe price IDs are strings (format: price_...). The parameter is assigned from newStripePrice.id (Stripe API response) and ghostProductPrice.get('stripe_price_id') (database field), both of which are strings. The incorrect type annotation causes incorrect TypeScript/JSDoc type inference.
Suggested fix
- * `@param` {number} stripePriceId
+ * `@param` {string} stripePriceId📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * @param {number} stripePriceId | |
| * `@param` {string} stripePriceId |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@ghost/core/core/server/services/members/importer/members-csv-importer-stripe-utils.js`
at line 188, Update the JSDoc for the stripePriceId parameter in
members-csv-importer-stripe-utils.js from {number} to {string}; specifically
change the `@param` annotation for stripePriceId so it reflects Stripe price IDs
as strings (they come from newStripePrice.id and
ghostProductPrice.get('stripe_price_id')), ensuring correct TypeScript/JSDoc
type inference for any functions that accept stripePriceId.
| * @param {String} imageType - What is the image used for. Example - icon, thumbnail | ||
| * @param {string} imageUrl - URL of the image to process | ||
| * @param {string} imageType - What is the image used for. Example - icon, thumbnail | ||
| * @returns {Promise<String>} - URL where the image is stored |
There was a problem hiding this comment.
Inconsistent JSDoc type on return value.
The return type still uses uppercase String while the parameter types on lines 147-148 were correctly updated to lowercase string. This should be updated for consistency with the PR's objective.
📝 Proposed fix
- * `@returns` {Promise<String>} - URL where the image is stored
+ * `@returns` {Promise<string>} - URL where the image is stored📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * @returns {Promise<String>} - URL where the image is stored | |
| * `@returns` {Promise<string>} - URL where the image is stored |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/core/server/services/oembed/oembed-service.js` at line 149, Update
the JSDoc `@returns` type in the oembed-service.js JSDoc block from uppercase
"String" to lowercase "string" to match the parameter types already updated on
the same docblock; edit the `@returns` line for the method documented there so the
return type is "string" for consistency.
| * | ||
| * @param {String} filepath | ||
| * @param {string} filepath | ||
| * @returns {Promise<String | null>} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Read-only verification: find remaining wrapper primitive JSDoc types in JS/TS files.
rg -nP --type-add 'jsall:*.{js,jsx,ts,tsx}' --type jsall \
'@(?:param|returns?)\s*\{[^}]*\b(String|Number|Boolean)\b[^}]*\}'Repository: TryGhost/Ghost
Length of output: 7354
🏁 Script executed:
cat -n ghost/core/core/server/web/api/middleware/upload.js | sed -n '165,230p'Repository: TryGhost/Ghost
Length of output: 2268
Finish the primitive-type migration in @returns annotations.
@returns still uses String in three places on lines 171, 197, and 223; this is inconsistent with the PR objective and with lowercase string used in @param annotations elsewhere in the same file.
Suggested fixes
- * `@returns` {Promise<String | null>}
+ * `@returns` {Promise<string | null>}- * `@returns` {String | null}
+ * `@returns` {string | null>}- * `@returns` {Promise<String | null>}
+ * `@returns` {Promise<string | null>}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/core/server/web/api/middleware/upload.js` at line 171, Replace the
primitive-type `String` in JSDoc `@returns` annotations with lowercase `string`
so the signatures read `@returns {Promise<string | null>}` (and similarly for
the other two occurrences that currently use `String`) to match the `@param`
annotations and complete the primitive-type migration.
| * | ||
| * @param {Object} options | ||
| * @param {Boolean} options.truncate whether to truncate rather thann fully reset | ||
| * @param {boolean} options.truncate whether to truncate rather thann fully reset |
There was a problem hiding this comment.
Fix typo in JSDoc description (Line 43).
thann should be than in the options.truncate description.
✏️ Suggested patch
- * `@param` {boolean} options.truncate whether to truncate rather thann fully reset
+ * `@param` {boolean} options.truncate whether to truncate rather than fully reset📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * @param {boolean} options.truncate whether to truncate rather thann fully reset | |
| * `@param` {boolean} options.truncate whether to truncate rather than fully reset |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ghost/core/test/utils/db-utils.js` at line 43, Fix the JSDoc typo in the
db-utils.js comment: update the description for the options.truncate parameter
(currently reads "whether to truncate rather thann fully reset") to correct
"thann" to "than" so it reads "whether to truncate rather than fully reset" in
the JSDoc block near the options.truncate documentation.
no ref
This is a types-only change that should have no user impact.
This is, effectively, the whole diff:
```diff
-@param {String} foo
+@param {string} foo
```
`String` is less correct than `string`, and [will not be supported by
TypeScript in an upcoming version][0].
All I did was run `sed` on a bunch of files.
[0]: https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#javascript-checking-and-jsdoc-compatibility
bca3bad to
63ca4e4
Compare
|
|
Choosing to ignore comments that are existing issues, including spots I missed. (I still think this change is an improvement.)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27430 +/- ##
=======================================
Coverage 73.43% 73.43%
=======================================
Files 1553 1553
Lines 124901 124901
Branches 15096 15096
=======================================
+ Hits 91721 91723 +2
+ Misses 32174 32173 -1
+ Partials 1006 1005 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
no ref
This is a types-only change that should have no user impact.
This is, effectively, the whole diff:
```diff
-@param {String} foo
+@param {string} foo
```
`String` is less correct than `string`, and [will not be supported by
TypeScript in an upcoming version][0].
All I did was run `sed` on a bunch of files.
[0]: https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#javascript-checking-and-jsdoc-compatibility



no ref
This is a types-only change that should have no user impact.
This is, effectively, the whole diff:
Stringis less correct thanstring, and will not be supported by TypeScript in an upcoming version.All I did was run
sedon a bunch of files.