Skip to content

Add a lint to check for conditional imports/exports on legacy web libraries #61875

Description

@srujzs

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.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codestype-enhancementA request for a change that isn't a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions