diff --git a/apps/oxlint/src/lint.rs b/apps/oxlint/src/lint.rs index 025d7e4c66e18..ae14276cd3496 100644 --- a/apps/oxlint/src/lint.rs +++ b/apps/oxlint/src/lint.rs @@ -239,7 +239,6 @@ impl CliRunner { if external_plugin_store.is_empty() { external_linter = None; } else { - #[cfg(not(any(test, feature = "force_test_reporter")))] #[expect(clippy::print_stderr)] { eprintln!( diff --git a/apps/oxlint/test/fixtures/basic_custom_plugin/output.snap.md b/apps/oxlint/test/fixtures/basic_custom_plugin/output.snap.md index 7f4cd68d41b67..379bbfd6a467f 100644 --- a/apps/oxlint/test/fixtures/basic_custom_plugin/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_custom_plugin/output.snap.md @@ -19,3 +19,9 @@ Found 1 warning and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/basic_custom_plugin_many_files/output.snap.md b/apps/oxlint/test/fixtures/basic_custom_plugin_many_files/output.snap.md index fc2c001a70f3f..15987d8da2cc2 100644 --- a/apps/oxlint/test/fixtures/basic_custom_plugin_many_files/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_custom_plugin_many_files/output.snap.md @@ -266,3 +266,9 @@ Found 20 warnings and 20 errors. Finished in Xms on 20 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/basic_custom_plugin_multiple_rules/output.snap.md b/apps/oxlint/test/fixtures/basic_custom_plugin_multiple_rules/output.snap.md index 8b375b5b750d0..85ebc1970724c 100644 --- a/apps/oxlint/test/fixtures/basic_custom_plugin_multiple_rules/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_custom_plugin_multiple_rules/output.snap.md @@ -43,3 +43,9 @@ Found 2 warnings and 3 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/basic_custom_plugin_warn_severity/output.snap.md b/apps/oxlint/test/fixtures/basic_custom_plugin_warn_severity/output.snap.md index c6e86984c3d91..444440fe2b40e 100644 --- a/apps/oxlint/test/fixtures/basic_custom_plugin_warn_severity/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_custom_plugin_warn_severity/output.snap.md @@ -19,3 +19,9 @@ Found 2 warnings and 0 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/built_in_errors/output.snap.md b/apps/oxlint/test/fixtures/built_in_errors/output.snap.md index 6073650173d14..81809c9b92642 100644 --- a/apps/oxlint/test/fixtures/built_in_errors/output.snap.md +++ b/apps/oxlint/test/fixtures/built_in_errors/output.snap.md @@ -13,3 +13,7 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md b/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md index 91a4ebf4dc45a..56806f4a07814 100644 --- a/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md +++ b/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md @@ -6,3 +6,7 @@ Found 0 warnings and 0 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/context_properties/output.snap.md b/apps/oxlint/test/fixtures/context_properties/output.snap.md index 8c7289c9d93dd..2fd90f4c33720 100644 --- a/apps/oxlint/test/fixtures/context_properties/output.snap.md +++ b/apps/oxlint/test/fixtures/context_properties/output.snap.md @@ -42,3 +42,9 @@ Found 0 warnings and 6 errors. Finished in Xms on 2 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/createOnce/output.snap.md b/apps/oxlint/test/fixtures/createOnce/output.snap.md index 17a2e6376296b..095e9294e08f4 100644 --- a/apps/oxlint/test/fixtures/createOnce/output.snap.md +++ b/apps/oxlint/test/fixtures/createOnce/output.snap.md @@ -258,3 +258,9 @@ Found 0 warnings and 42 errors. Finished in Xms on 2 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_disable_directives/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_disable_directives/output.snap.md index 86fc72cdc2ede..0c3ea4d714b80 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_disable_directives/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_disable_directives/output.snap.md @@ -46,3 +46,9 @@ Found 0 warnings and 5 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_import_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_import_error/output.snap.md index 2858eb803e97b..43edd338621dd 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_import_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_import_error/output.snap.md @@ -9,3 +9,7 @@ Failed to parse configuration file. | Error: whoops! | at /apps/oxlint/test/fixtures/custom_plugin_import_error/plugin.js:1:7 ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/output.snap.md index c3a996a2880a3..6bee5e2dd5256 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_after_hook_error/output.snap.md @@ -11,3 +11,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_before_hook_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_before_hook_error/output.snap.md index c2fef75294169..2beefd11f40a7 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_before_hook_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_before_hook_error/output.snap.md @@ -11,3 +11,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_createOnce_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_createOnce_error/output.snap.md index d5ca6589d1aa8..2f64101c30010 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_createOnce_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_createOnce_error/output.snap.md @@ -9,3 +9,7 @@ Failed to parse configuration file. | Error: Whoops! | at Object.createOnce (/apps/oxlint/test/fixtures/custom_plugin_lint_createOnce_error/plugin.js:8:15) ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_create_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_create_error/output.snap.md index ef0d3a1aa8490..6518746157b5c 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_create_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_create_error/output.snap.md @@ -11,3 +11,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_fix_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_fix_error/output.snap.md index cd464eef13f1f..77742e812a9d4 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_fix_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_fix_error/output.snap.md @@ -12,3 +12,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_lint_visit_error/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_lint_visit_error/output.snap.md index f01c7e09d3de1..6c7b09b199064 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_lint_visit_error/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_lint_visit_error/output.snap.md @@ -11,3 +11,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_missing_rule/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_missing_rule/output.snap.md index 427d5f42bcdc7..4ac74b1405b1c 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_missing_rule/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_missing_rule/output.snap.md @@ -7,3 +7,7 @@ Failed to parse configuration file. x Rule 'unknown-rule' not found in plugin 'basic-custom-plugin' ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_via_overrides/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_via_overrides/output.snap.md index 7f4cd68d41b67..379bbfd6a467f 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_via_overrides/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_via_overrides/output.snap.md @@ -19,3 +19,9 @@ Found 1 warning and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/custom_plugin_via_overrides_missing_rule/output.snap.md b/apps/oxlint/test/fixtures/custom_plugin_via_overrides_missing_rule/output.snap.md index 524a88407fdac..a5e5f3b1cba1b 100644 --- a/apps/oxlint/test/fixtures/custom_plugin_via_overrides_missing_rule/output.snap.md +++ b/apps/oxlint/test/fixtures/custom_plugin_via_overrides_missing_rule/output.snap.md @@ -7,3 +7,7 @@ Failed to build configuration. x Rule 'missing' not found in plugin 'basic-custom-plugin' ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/definePlugin/eslint.snap.md b/apps/oxlint/test/fixtures/definePlugin/eslint.snap.md index 40f1a58d95f58..749017556a5dd 100644 --- a/apps/oxlint/test/fixtures/definePlugin/eslint.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin/eslint.snap.md @@ -89,3 +89,7 @@ filename: files/2.js define-plugin-plugin ✖ 35 problems (35 errors, 0 warnings) ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/definePlugin/output.snap.md b/apps/oxlint/test/fixtures/definePlugin/output.snap.md index 0c12d5aa169fa..69d7f2fffeba5 100644 --- a/apps/oxlint/test/fixtures/definePlugin/output.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin/output.snap.md @@ -261,3 +261,9 @@ Found 0 warnings and 35 errors. Finished in Xms on 2 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/eslint.snap.md b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/eslint.snap.md index dd3cdcd9154eb..016a0ea393646 100644 --- a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/eslint.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/eslint.snap.md @@ -89,3 +89,7 @@ filename: files/2.js define-plugin-and-ru ✖ 35 problems (35 errors, 0 warnings) ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md index 4dc313640aa76..20460e0f7c9a3 100644 --- a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md @@ -261,3 +261,9 @@ Found 0 warnings and 35 errors. Finished in Xms on 2 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/defineRule/eslint.snap.md b/apps/oxlint/test/fixtures/defineRule/eslint.snap.md index 513cb0901d84b..4015cf7b12cea 100644 --- a/apps/oxlint/test/fixtures/defineRule/eslint.snap.md +++ b/apps/oxlint/test/fixtures/defineRule/eslint.snap.md @@ -89,3 +89,7 @@ filename: files/2.js define-rule-plugin/c ✖ 35 problems (35 errors, 0 warnings) ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/defineRule/output.snap.md b/apps/oxlint/test/fixtures/defineRule/output.snap.md index fc6107f5473dc..7e88d415e5e07 100644 --- a/apps/oxlint/test/fixtures/defineRule/output.snap.md +++ b/apps/oxlint/test/fixtures/defineRule/output.snap.md @@ -261,3 +261,9 @@ Found 0 warnings and 35 errors. Finished in Xms on 2 files using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/estree/output.snap.md b/apps/oxlint/test/fixtures/estree/output.snap.md index 8d0514b529b26..b4e7ce894d0fd 100644 --- a/apps/oxlint/test/fixtures/estree/output.snap.md +++ b/apps/oxlint/test/fixtures/estree/output.snap.md @@ -50,3 +50,9 @@ Found 0 warnings and 1 error. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/fixes/fixes_disabled.snap.md b/apps/oxlint/test/fixtures/fixes/fixes_disabled.snap.md index d47adb6a5b948..b19e68a750baf 100644 --- a/apps/oxlint/test/fixtures/fixes/fixes_disabled.snap.md +++ b/apps/oxlint/test/fixtures/fixes/fixes_disabled.snap.md @@ -101,6 +101,12 @@ Found 0 warnings and 12 errors. Finished in Xms on 1 file using X threads. ``` +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` + # Code after ``` debugger; diff --git a/apps/oxlint/test/fixtures/fixes/fixes_enabled.snap.md b/apps/oxlint/test/fixtures/fixes/fixes_enabled.snap.md index 89aca76902ca4..879ab429e1622 100644 --- a/apps/oxlint/test/fixtures/fixes/fixes_enabled.snap.md +++ b/apps/oxlint/test/fixtures/fixes/fixes_enabled.snap.md @@ -7,6 +7,12 @@ Found 0 warnings and 0 errors. Finished in Xms on 1 file using X threads. ``` +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` + # Code after ``` diff --git a/apps/oxlint/test/fixtures/load_paths/output.snap.md b/apps/oxlint/test/fixtures/load_paths/output.snap.md index 54d8efbb58d07..1401d94b5b024 100644 --- a/apps/oxlint/test/fixtures/load_paths/output.snap.md +++ b/apps/oxlint/test/fixtures/load_paths/output.snap.md @@ -49,3 +49,9 @@ Found 1 warning and 6 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/fixtures/missing_custom_plugin/output.snap.md b/apps/oxlint/test/fixtures/missing_custom_plugin/output.snap.md index f5c959fa9035c..e6fe8cb914044 100644 --- a/apps/oxlint/test/fixtures/missing_custom_plugin/output.snap.md +++ b/apps/oxlint/test/fixtures/missing_custom_plugin/output.snap.md @@ -8,3 +8,7 @@ Failed to parse configuration file. x Failed to load JS plugin: ./plugin.js | Cannot find module './plugin.js' ``` + +# stderr +``` +``` diff --git a/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md b/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md index c5a8f95401777..e38e1bc48f7dc 100644 --- a/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md +++ b/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md @@ -55,3 +55,9 @@ Found 3 warnings and 3 errors. Finished in Xms on 1 file using X threads. ``` + +# stderr +``` +WARNING: JS plugins are experimental and not subject to semver. +Breaking changes are possible while JS plugins support is under development. +``` diff --git a/apps/oxlint/test/utils.ts b/apps/oxlint/test/utils.ts index 555f73245d185..343381a9f04b9 100644 --- a/apps/oxlint/test/utils.ts +++ b/apps/oxlint/test/utils.ts @@ -32,7 +32,7 @@ interface TestFixtureOptions { export async function testFixtureWithCommand(options: TestFixtureOptions): Promise { const fixtureDirPath = pathJoin(FIXTURES_DIR_PATH, options.fixtureName); - let { stdout, exitCode } = await execa(options.command, options.args, { + let { stdout, stderr, exitCode } = await execa(options.command, options.args, { cwd: fixtureDirPath, reject: false, }); @@ -40,8 +40,10 @@ export async function testFixtureWithCommand(options: TestFixtureOptions): Promi const snapshotPath = pathJoin(fixtureDirPath, `${options.snapshotName}.snap.md`); stdout = normalizeStdout(stdout); + stderr = normalizeStdout(stderr); let snapshot = `# Exit code\n${exitCode}\n\n` + - `# stdout\n\`\`\`\n${stdout}\`\`\`\n`; + `# stdout\n\`\`\`\n${stdout}\`\`\`\n\n` + + `# stderr\n\`\`\`\n${stderr}\`\`\`\n`; if (options.getExtraSnapshotData) { const extraSnapshots = await options.getExtraSnapshotData(fixtureDirPath);