fix: Ensure languageOptions.customSyntax is serializable#212
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a serialization issue with ESLint configuration by ensuring that languageOptions.customSyntax containing functions can be properly serialized to JSON. This is necessary for ESLint features like configuration caching.
- Added
normalizeLanguageOptions()method to handle serialization of customSyntax configurations - Enhanced test coverage for both unit and integration scenarios
- Updated JSDoc documentation for consistency
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/languages/css-language.js | Implements serialization logic with normalizeLanguageOptions() method and helper function |
| tests/languages/css-language.test.js | Unit tests for the new normalization functionality |
| tests/plugin/eslint.test.js | Integration tests validating serialization behavior through ESLint |
fasttime
reviewed
Aug 5, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
20e1b8a to
e4890b0
Compare
fasttime
reviewed
Sep 10, 2025
|
/easycla |
2 similar comments
|
/easycla |
|
/easycla |
Co-authored-by: Francesco Trotta <github@fasttime.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request?
Ensures that
languageOptions.customSyntaxis serializable by replacing all functions withtrue. CSSTree allows functions in its config and we need to account for that to allow things like caching in ESLint.What changes did you make? (Give an overview)
CSSLanguage#normalizeLanguageOptions()that adds atoJSONmethod when thecustomSyntaxoption is presentCSSLanguagetests to validate the new functionality works.Related Issues
fixes #211
Is there anything you'd like reviewers to focus on?