knex_dart_lint 0.3.1
knex_dart_lint: ^0.3.1 copied to clipboard
Optional analyzer plugin for dialect-aware Knex Dart capability checks.
knex_dart_lint #
Optional analyzer plugin for knex_dart, built on analysis_server_plugin.
This package provides dialect-aware warnings for query APIs that are unsupported for the inferred driver.
Rule Catalog #
Dialect capability rules #
dialect_unsupported_returningdialect_unsupported_full_outer_joindialect_unsupported_lateral_joindialect_unsupported_on_conflict_mergedialect_unsupported_ctedialect_unsupported_window_functionsdialect_unsupported_jsondialect_unsupported_intersect_except
Query argument correctness rules #
invalid_where_operatorwhere_null_valueinvalid_order_directionlimit_non_int_argumentinsert_wrong_value_typewhere_null_typed_value
Enable #
Add a top-level plugins section to the analysis_options.yaml at the root
of your package or workspace (plugins
cannot be enabled from a nested analysis options file):
plugins:
knex_dart_lint: ^0.3.0
While developing against a local checkout, use a path instead:
plugins:
knex_dart_lint:
path: ../packages/knex_dart_lint
No separate dev dependency or CLI runner is needed — knex_dart_lint is a
native analyzer plugin, so its diagnostics show up directly from dart analyze / flutter analyze and in the IDE, the same as built-in lints.
Restart the Dart Analysis Server (or your IDE) after changing the plugins
section for the change to take effect.
Enabling an opt-in rule #
Warning-severity rules are on by default. Opt-in lint rules — currently just
where_null_value — are disabled by default and must be enabled under
diagnostics:
plugins:
knex_dart_lint:
version: ^0.3.0
diagnostics:
where_null_value: true
Confidence behavior #
Dialect capability rules emit diagnostics only when dialect inference is high-confidence. If inference is unknown, those rules intentionally stay silent.
Suppressing a diagnostic #
// ignore: knex_dart_lint/dialect_unsupported_returning
// ignore_for_file: knex_dart_lint/dialect_unsupported_returning
Troubleshooting #
If diagnostics don't show up:
- Confirm
analysis_options.yamlhas a top-levelplugins:section (not nested underanalyzer:— that was the oldcustom_lintlayout). - Run
dart pub getin the workspace and the consuming app. - Restart the Dart Analysis Server / restart the IDE.
- Ensure the IDE can resolve
dartfrom its environmentPATH.
See docs/mvp_rules.md for the locked rule contract.