Note:import_lint requires Dart 3.10 or later (analyzer plugin support
was added in Dart 3.10 / Flutter 3.38). The top-level plugins: section is
the new analyzer plugin system. After any change to the plugins: section,
the Dart Analysis Server must be restarted to see the effects
(VS Code: Dart: Restart Analysis Server).
By adding import_lint plugin to get the warnings directly in your IDE by configuring.
To change the severity of a rule, add a severity key to the rule configuration.
warning (default)
error (exit code 1 when lint is found)
import_lint:severity:"error"rules:...
Note on IDE severity: The severity: "error" setting is honored by
dart run import_lint (exit code 1). In the IDE, analysis_server_plugin
registers a fixed warning severity. To see import_lint errors as errors
in the IDE, add this to analysis_options.yaml:
analyzer:errors:import_lint:error
Contribution
Welcome PRs!
To develop locally, clone the repo and enable the plugin from a local path in
your host project's analysis_options.yaml:
Then run dart pub get in the host project and restart the Dart Analysis
Server. No separate tools/analyzer_plugin directory is needed — the plugin
entry point is lib/main.dart in this package.