This repository was archived by the owner on Aug 31, 2023. It is now read-only.
feat(rome_cli): enable organize imports via CLI/configuration #4191
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.
Summary
This PR adds support for sorting imports via CLI and configuration.
The sorting of imports will be part of the
check
command, as it's best suited for the analyzer (relative discussion about the reasons #3978).As for now, there's no configuration in particular for the sort of imports, we should hold onto that and add a new configuration once we think that the algorithm is stable.
Here's the list of changes:
--organize-imports-enabled
for therome ci
command;organizeImports
section in the configuration file;fix_all
function in the JavaScript file handlers, which will include thecorrectness/organizeImports
rule if the option is enabled;Test Plan
Added new tests to cover the new scenarios
Documentation