diff --git a/crates/rome_cli/tests/configs.rs b/crates/rome_cli/tests/configs.rs index 26924a97272..4ae00d5cf72 100644 --- a/crates/rome_cli/tests/configs.rs +++ b/crates/rome_cli/tests/configs.rs @@ -10,7 +10,7 @@ pub const CONFIG_FORMAT: &str = r#"{ pub const CONFIG_INIT_DEFAULT: &str = r#"{ "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": true, @@ -24,7 +24,7 @@ pub const CONFIG_INIT_DEFAULT: &str = r#"{ pub const CONFIG_INIT_DEFAULT_WHEN_INSTALLED: &str = r#"{ "$schema": "./node_modules/rome/configuration_schema.json", "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": true, diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/deprecated_suppression_comment.snap b/crates/rome_cli/tests/snapshots/main_commands_check/deprecated_suppression_comment.snap index 19889f35d84..9226e528fbf 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/deprecated_suppression_comment.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/deprecated_suppression_comment.snap @@ -38,6 +38,18 @@ file.js:1:1 suppressions/deprecatedSyntax FIXABLE ━━━━━━━━━ 2 2 │ a == b; +``` + +```block +file.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + i Import statements could be sorted: + + 1 │ - //·rome-ignore·lint(suspicious/noDoubleEquals):·test + 1 │ + //·rome-ignore·lint/suspicious/noDoubleEquals:·test + 2 2 │ a == b; + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap index 9c502cf1cc5..f776c02f6ab 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap @@ -21,6 +21,14 @@ check.js lint ━━━━━━━━━━━━━━━━━━━━━━ × Size of check.js is 1.0 MiB which exceeds configured maximum of 1.0 MiB for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +check.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of check.js is 1.0 MiB which exceeds configured maximum of 1.0 MiB for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap index ef307287ab8..02ad67d748c 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap @@ -28,6 +28,14 @@ check.js lint ━━━━━━━━━━━━━━━━━━━━━━ × Size of check.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +check.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of check.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap index 57afa9d8050..4ea0d22342c 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap @@ -38,6 +38,14 @@ check.js lint ━━━━━━━━━━━━━━━━━━━━━━ × Size of check.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +check.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of check.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap index c758368824a..4007bb83905 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap @@ -21,6 +21,14 @@ ci.js lint ━━━━━━━━━━━━━━━━━━━━━━━ × Size of ci.js is 1.0 MiB which exceeds configured maximum of 1.0 MiB for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +ci.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of ci.js is 1.0 MiB which exceeds configured maximum of 1.0 MiB for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap index e9193ed09e6..53c3eae0761 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap @@ -28,6 +28,14 @@ ci.js lint ━━━━━━━━━━━━━━━━━━━━━━━ × Size of ci.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +ci.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of ci.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap index aa61b9864d2..f0280bde12f 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap @@ -38,6 +38,14 @@ ci.js lint ━━━━━━━━━━━━━━━━━━━━━━━ × Size of ci.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. +``` + +```block +ci.js organizeImports ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + × Size of ci.js is 27 B which exceeds configured maximum of 16 B for this project. The file size limit exists to prevent us inadvertently slowing down and loading large files that we shouldn't. + + ``` ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file.snap b/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file.snap index b14680c91e8..fd194508c2f 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file.snap @@ -7,7 +7,7 @@ expression: content ```json { "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": true, diff --git a/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file_when_rome_installed_via_package_manager.snap b/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file_when_rome_installed_via_package_manager.snap index cbb31ccc26d..9c71983e278 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file_when_rome_installed_via_package_manager.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_init/creates_config_file_when_rome_installed_via_package_manager.snap @@ -8,7 +8,7 @@ expression: content { "$schema": "./node_modules/rome/configuration_schema.json", "organizeImports": { - "enabled": false + "enabled": true }, "linter": { "enabled": true, diff --git a/crates/rome_cli/tests/snapshots/main_commands_rage/with_configuration.snap b/crates/rome_cli/tests/snapshots/main_commands_rage/with_configuration.snap index 5dc79bc8838..fe67d1ae94e 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_rage/with_configuration.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_rage/with_configuration.snap @@ -35,7 +35,7 @@ Rome Configuration: Status: Loaded successfully Formatter disabled: true Linter disabled: false - Organize imports disabled: true + Organize imports disabled: false VCS disabled: true Server: diff --git a/crates/rome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snap b/crates/rome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snap index 0b26a9a55a4..c65a30fe0d7 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snap @@ -36,7 +36,7 @@ Rome Configuration: Status: Loaded with errors Formatter disabled: false Linter disabled: false - Organize imports disabled: true + Organize imports disabled: false VCS disabled: true Server: diff --git a/crates/rome_service/src/configuration/organize_imports.rs b/crates/rome_service/src/configuration/organize_imports.rs index b353b72ef53..b7080f817d6 100644 --- a/crates/rome_service/src/configuration/organize_imports.rs +++ b/crates/rome_service/src/configuration/organize_imports.rs @@ -24,7 +24,7 @@ pub struct OrganizeImports { impl Default for OrganizeImports { fn default() -> Self { Self { - enabled: Some(false), + enabled: Some(true), ignore: None, } } diff --git a/editors/vscode/configuration_schema.json b/editors/vscode/configuration_schema.json index 97a1f0799b1..ef9d37221c2 100644 --- a/editors/vscode/configuration_schema.json +++ b/editors/vscode/configuration_schema.json @@ -1051,7 +1051,7 @@ "properties": { "enabled": { "description": "Enables the organization of imports", - "default": false, + "default": true, "type": ["boolean", "null"] }, "ignore": { diff --git a/npm/rome/configuration_schema.json b/npm/rome/configuration_schema.json index 97a1f0799b1..ef9d37221c2 100644 --- a/npm/rome/configuration_schema.json +++ b/npm/rome/configuration_schema.json @@ -1051,7 +1051,7 @@ "properties": { "enabled": { "description": "Enables the organization of imports", - "default": false, + "default": true, "type": ["boolean", "null"] }, "ignore": {