Came up in a convo with @kevmoo, but we should considering adding a lint when users use the legacy web libraries listed in the left nav on https://api.dart.dev/. These libraries are deprecated and may be removed, which would make various code that depends on the conditional break.
The one caveat is we do advise users who are specifically differentiating between JS and Wasm compiles to use dart.library.html, but I still think we should lint there. If users know what they're doing, they can ignore that, but the risk still exists that dart:html will be removed at some point in the future. We should instead expose a robust way to differentiate between JS and Wasm compiles.
Users should use dart.library.js_interop to differentiate between the VM and Web.
Came up in a convo with @kevmoo, but we should considering adding a lint when users use the legacy web libraries listed in the left nav on
https://api.dart.dev/. These libraries are deprecated and may be removed, which would make various code that depends on the conditional break.The one caveat is we do advise users who are specifically differentiating between JS and Wasm compiles to use
dart.library.html, but I still think we should lint there. If users know what they're doing, they can ignore that, but the risk still exists thatdart:htmlwill be removed at some point in the future. We should instead expose a robust way to differentiate between JS and Wasm compiles.Users should use
dart.library.js_interopto differentiate between the VM and Web.