feat: Add rule configuration object support for tsgolint headless mode #13099
+260
−16
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.
Implements support for rule configuration objects in tsgolint headless mode as requested in oxc-project/tsgolint#51.
Problem
The current tsgolint headless mode only supports passing rule names as an array:
This prevents users from configuring rules on a per-file basis, which is essential for complex projects with varying rule requirements across different files.
Solution
Added support for rule configuration objects while maintaining full backward compatibility:
Implementation Details
TsGoLintRules
enum supporting bothArray(Vec<String>)
andObject(Map<String, Value>)
formatsOXLINT_TSGOLINT_OBJECT_FORMAT=1
for testingRuleEnum
instancesTesting
Added comprehensive test suite covering:
Future Work
This implementation provides the foundation for rule configuration support. Next steps include:
RuleEnum
instancesThe changes are minimal and surgical, maintaining full backward compatibility while enabling the requested functionality.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.