Printable idea sheet
unused_imports
reqlan rq/language/imports.rq:167
Katz 0.057
An import binding that is never referenced by any local reference in the importing file is unused.
A `from "path" import idea` binds `idea`; a `from "path" import idea as alias` binds `alias`; `import "path" as ns` binds `ns`; `import "path".ideaset.idea as alias` binds `alias` or `idea`; a bare `import "path"` ( no `as` ) binds nothing and is always unused since anonymous references ( `idea` ) never need it.
Used names are those that appear as `Local` ( `name` / `name` or `idea` with qualifier = alias ) or as `IdeaSet` members ( `ideaset foo { member1, member2 }` ).
The severity is configurable per `.reqlan/config.json` ( `unusedImports`: `"warn"` | `"error"` | `"off"`, default `"warn"` ) and via VS Code setting `reqlan.unusedImports`. The `reqlan.check` CLI accepts `--unused-imports <warn|error|off>`, overriding the config for that run.
When set to `warn`, emit `warning`; when `error`, emit `error`; when `off`, suppress the diagnostic entirely.
Lines preceded by `//rq-ignore-error` suppress the unused import diagnostic, matching comment_reference_ignore.
Editor: emit `DiagnosticTag.Unnecessary` so VS Code dims / fades the line; provide a Quick Fix ( `Remove unused import` ) that removes the specifier ( with its comma ) for `from` imports or the entire import line for namespace / qualified / bare imports.
Related: import_tokenisation, anonymous_imports_allowed, import_does_not_exist_error, configuration_import_roots.
- implementation
- config.schema.json, ast.rs, imports.rs, analysis.rs, code_actions.rs, package.json, check.ts
- status
- in-progress
Interactive page: unused_imports