Idea detail
unused_import_diagnostics
reqlan rq/extension/language/support/features-imports.rq:12
Summary
Unused import bindings are detected per-file: every specifier of `from "path" import a, b`, every alias of `import "path" as ns`, and every bound name of `import "path".ideaset.idea as alias` is checked against all `Local` references ( `name` / `name` or `idea` where qualifier matches the alias ) and `IdeaSet` members.
If the config is `"warn"` ( default ), each unused specifier emits a `warning` diagnostic with `DiagnosticTag.Unnecessary`; `"error"` emits `error`; `"off"` suppresses the diagnostic entirely.
The `reqlan.check` CLI accepts `--unused-imports <warn|error|off>`; per-file `.reqlan/config.json` `unusedImports` setting applies per source file ' s base.
Lines after `//rq-ignore-error` suppress this diagnostic, matching comment_reference_ignore.
In the editor, emit `DiagnosticSeverity.Warning` or `Error` with code `"unused-import"` and tag `Unnecessary`. Provide a Quick Fix that removes the specifier ( with its comma ) from `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.
Navigation
Attributes
| Key | Value |
|---|---|
| implementation | config.schema.json, ast.rs, imports.rs, analysis.rs, code_actions.rs, package.json, check.ts |
| status | in-progress |
Ancestor context
No ancestor chain recorded.
Outbound references
Inbound references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| None | |||
Unresolved references
| Kind | Idea | Path | Snippet |
|---|---|---|---|
| None | |||
Local graph
Initialising graph…