When the VM migrates to only support strong null safety, it still needs to account for dart2js being unmigrated and potentially running in weak mode. This would mean the following Dart CLI command should work
dart compile js test.dart
dart itself would invoke the dartdev isolate in strong null safety mode but once it is determined that the command is to invoke dart2js we would have to flip the VM to no-sound-null-safety mode before invoking dart2js.dart.
The other option is to always require JS compilation on the command line tool as
dart --no-sound-null-safety compile js test.dart
which does not appear to be very ergonomic.
This issue would be moot if dart2js is migrated to strong null safety before we flip the VM to only support strong null safety