feat: Add typeAware option to the generated config when relevant.#406
Merged
feat: Add typeAware option to the generated config when relevant.#406
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the oxlint-migrate tool to automatically add the typeAware configuration option when type-aware rules are detected in the migration output. This aligns with Oxlint's upcoming support for the typeAware config option.
Changes:
- Added
OxlintOptionstype withtypeAwareandtypeCheckproperties to the configuration schema - Implemented logic to detect type-aware rules in the output config and enable the
typeAwareoption when the--type-awareflag is used - Updated documentation and help text to reflect that the config option will be automatically set
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Added OxlintOptions type and integrated it into OxlintConfig, removed unnecessary eslint-disable comment |
| src/index.ts | Imported typeAwareRules and added logic to set options.typeAware when type-aware rules are detected |
| src/index.spec.ts | Added comprehensive tests for the typeAware option behavior in various scenarios |
| src/plugins_rules.ts | Removed outdated TODO comment |
| bin/oxlint-migrate.ts | Updated help text to mention the config option |
| README.md | Updated documentation to explain that the typeAware config option will be set |
| integration_test/snapshots/*.snap | Updated snapshots to reflect the new options.typeAware field in outputs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sulting config. For when the `--type-aware` flag is used and at least 1 type-aware rule is found. If the `--type-aware` flag is used but no type-aware rules are found, the `typeAware` option will not be enabled, as there would be no point in doing so. I was hoping to avoid adding an extra loop to the index.ts that has to check every rule, but it isn't going to be that slow and the alternatives I can think of would all be pretty jank, so.
…n if the type-aware rules are only in overrides.
0e5cfde to
dc89178
Compare
Sysix
reviewed
Feb 27, 2026
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.
This is supported in the Oxlint config file with the next release, so let's start generating configs accordingly.
When the
--type-awareflag is used in oxlint-migrate and at least 1 type-aware rule is found, enable the option.If the
--type-awareflag is used but no type-aware rules are found, thetypeAwareoption will not be enabled, as there would be no point in doing so.I was hoping to avoid adding an extra loop to the index.ts that has to check every rule, but it isn't going to be that slow and the alternatives I can think of would all be pretty jank, so.
AI Disclosure: Only used for the
allOutputRulescheck to find whether the config had any type-aware rules.We can make the change to default-enable the
--typeAwareflag in a separate PR after this one.