Add type declarations for PrismJS component dependencies and loader#74420
Add type declarations for PrismJS component dependencies and loader#74420tcaesvk wants to merge 1 commit intoDefinitelyTyped:masterfrom
Conversation
|
@tcaesvk Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 7 days. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74420,
"author": "tcaesvk",
"headCommitOid": "b52973155ce65f4ab88aa263a69ec34a058b7788",
"mergeBaseOid": "ab0b2c621246bfd1bf503a7c5e06735451fc7cb5",
"lastPushDate": "2026-01-30T02:58:17.000Z",
"lastActivityDate": "2026-02-06T03:23:42.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "prismjs",
"kind": "edit",
"files": [
{
"path": "types/prismjs/dependencies.d.ts",
"kind": "definition"
}
],
"owners": [
"RunDevelopment",
"ExE-Boss",
"eriklieben",
"andrewiggins",
"typeofweb"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "stale",
"reviewer": "sheetalkamat",
"date": "2026-02-03T19:37:54.000Z",
"abbrOid": "0cbbcec"
},
{
"type": "stale",
"reviewer": "RunDevelopment",
"date": "2026-02-03T12:37:52.000Z",
"abbrOid": "0cbbcec"
}
],
"mainBotCommentID": 3821539478,
"ciResult": "pass"
} |
|
Hey @tcaesvk, 😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you! |
|
🔔 @RunDevelopment @ExE-Boss @eriklieben @andrewiggins @typeofweb — please review this PR in the next few days. Be sure to explicitly select |
82b2918 to
2596e81
Compare
The |
RunDevelopment
left a comment
There was a problem hiding this comment.
The definition of ComponentEntry needs a tiny change. Otherwise gtg.
types/prismjs/dependencies.d.ts
Outdated
| title: string; | ||
| owner: string; | ||
| noCSS?: boolean; | ||
| alias: string | readonly string[]; | ||
| aliasTitles: Readonly<Record<string, string>>; | ||
|
|
||
| optional: string | readonly string[]; | ||
| require: string | readonly string[]; | ||
| modify: string | readonly string[]; |
There was a problem hiding this comment.
According to this type def, all these properties should be optional, not just noCSS.
I'm not sure why even title is otpional, but I probably had my reasons back then.
| title: string; | |
| owner: string; | |
| noCSS?: boolean; | |
| alias: string | readonly string[]; | |
| aliasTitles: Readonly<Record<string, string>>; | |
| optional: string | readonly string[]; | |
| require: string | readonly string[]; | |
| modify: string | readonly string[]; | |
| title?: string; | |
| owner?: string; | |
| noCSS?: boolean; | |
| alias?: string | readonly string[]; | |
| aliasTitles?: Readonly<Record<string, string>>; | |
| optional?: string | readonly string[]; | |
| require?: string | readonly string[]; | |
| modify?: string | readonly string[]; |
There was a problem hiding this comment.
I amended commit according to JSDoc optional syntax
|
@tcaesvk One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
2596e81 to
0cbbcec
Compare
|
@RunDevelopment Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
⏳ Hi @tcaesvk, It's been a few days since this PR was approved by RunDevelopment and we're waiting for a DT maintainer to give a review. If you would like to short-circuit this wait, you can edit some of the test files in the package that verify how the |
types/prismjs/dependencies.d.ts
Outdated
| load: LoadFunction; | ||
| } | ||
|
|
||
| export default function getLoader( |
There was a problem hiding this comment.
This needs export = instead of export default. Refer to https://github.com/DefinitelyTyped/DefinitelyTyped#a-package-uses-export--but-i-prefer-to-use-default-imports-can-i-change-export--to-export-default
c:\temp\test2>type a.js
var a = require("prismjs/dependencies.js")
console.log(a)
console.log(a.default)
c:\temp\test2>node a.js
[Function: getLoader]
undefined
sheetalkamat
left a comment
There was a problem hiding this comment.
Please address feedback
|
@tcaesvk One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
0cbbcec to
b529731
Compare
|
@sheetalkamat, @RunDevelopment Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
Please fill in this template.
pnpm test <package to test>.package.json.This PR add a declaration file for submodule to prevent TS7016
Could not find a declaration file for module 'prismjs/dependencies.js'error message by noImplicitAny option.