Skip to content

Conversation

@sushichan044
Copy link
Contributor

@sushichan044 sushichan044 commented Jan 8, 2026

fixes #1450

Now the starlight plugin checks whether Expressive Code is enabled.
If enabled, adds Expressive Code's config file as an entry.

@sushichan044 sushichan044 changed the title feat(starlight): handle Expressive Code's configuration file automatically feat(starlight): handle Expressive Code's configuration file Jan 8, 2026
@sushichan044 sushichan044 marked this pull request as ready for review January 9, 2026 01:28
Copy link
Member

@webpro webpro left a comment

Choose a reason for hiding this comment

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

Nice PR! Much appreciated 🌟

if (expressiveCodeProp && ts.isPropertyAssignment(expressiveCodeProp)) {
const initializer = expressiveCodeProp.initializer;
if (initializer.kind === ts.SyntaxKind.FalseKeyword) {
isExpressiveCodeEnabled = false;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could do an early bail out here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@webpro Are you referring to the early return like 4adfc7c?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, anything we can do to improve performance. If we have our answer, we can stop iterating.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 12, 2026

Open in StackBlitz

npm i https://pkg.pr.new/knip@1451

commit: e52ff81

@cylewaitforit
Copy link
Contributor

@webpro @sushichan044 Because expressive-code isn't exclusively a starlight feature, it felt funny to me to shoehorn this into the starlight plugin. So I took a try at reworking this branch into it's own knip plugin for expressive-code and opened that as #1493.

@webpro
Copy link
Member

webpro commented Jan 28, 2026

Everyone comes in with their own agenda, no solution is perfect here (as Starlight has expressive-code built-in). Your solution is great though! Let's close this one and roll with yours 🙏

@webpro webpro closed this Jan 28, 2026
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.

💡 add ec.config.mjs to entry in Starlight plugin

3 participants