-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)type-documentationA request to add or improve documentationA request to add or improve documentation
Description
The do_not_use_environment
lint tries to catch compile-time use of environment variables, that should be runtime uses.
The message, though, is entirely unclear about this. It just says:
Invalid use of a declared variable
For example, here is some code that triggers this lint:
const bool usingAppEngine = bool.hasEnvironment('APPENGINE_RUNTIME');
Also while I'm at it I should observe that the documentation (https://dart-lang.github.io/linter/lints/do_not_use_environment.html) does not give a "GOOD" code snippet.
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)type-documentationA request to add or improve documentationA request to add or improve documentation