fix: allow additional properties in CSSLanguageOptions - #538
lumirlumir wants to merge 4 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change moves CSS language option types into ChangesCSS type definitions
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The relocated CSS type contract remains publicly available and is covered by package-facing compile-time assertions, with no actionable merge risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
| /** | ||
| * Default syntax configuration representing the structure returned by `@eslint/css-tree/definition-syntax-data`. | ||
| */ | ||
| export type DefaultSyntaxConfig = CSSTreeDefaultSyntaxConfig; | ||
|
|
||
| /** | ||
| * A callback used to extend the default CSS syntax configuration. | ||
| */ | ||
| export type SyntaxExtensionCallback = ( | ||
| defaultSyntax: DefaultSyntaxConfig, | ||
| ) => Partial<SyntaxConfig>; | ||
|
|
||
| /** | ||
| * Language options provided for CSS files. | ||
| */ | ||
| export interface CSSLanguageOptions extends LanguageOptions { | ||
| /** | ||
| * Whether to be tolerant of recoverable parsing errors. | ||
| * @default false | ||
| */ | ||
| tolerant?: boolean; | ||
|
|
||
| /** | ||
| * Custom syntax to use for parsing. | ||
| */ | ||
| customSyntax?: Partial<SyntaxConfig> | SyntaxExtensionCallback; | ||
| } | ||
|
|
There was a problem hiding this comment.
These three types, which were previously inlined, have already been exported from the main entry point by the following code. Exporting them here does not introduce any new type exports.
Line 42 in 0658aa0
DMartens
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks. Leaving open for others to review.
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
While eslint/eslint#19615 (comment) determined that
XXXLanguageOptionscan have additional properties, andMarkdownLanguageOptionsalready extends theLanguageOptionstype from@eslint/core, the correspondingCSSLanguageOptionsdoes not allow additional properties.What changes did you make? (Give an overview)
So, I’ve updated
CSSLanguageOptionsto extendLanguageOptionsfrom@eslint/coreand added type test cases to verify that it allows additional properties.Just a note:
CSSLanguageOptionswas already being exported from the main entry point, so this PR doesn’t introduce a new feature and only includes a fix.Related Issues
languageOptionseslint#19615 (comment)JSONLanguageOptionsjson#271Is there anything you'd like reviewers to focus on?
I found it while working on eslint/markdown#706.
Summary by CodeRabbit
Documentation
Tests