Repository navigation
[Linting Rule] Unused Definitions
Generated from 'wiki-linter.ts' on 2026-11-07, 14:38:02 UTC (v2.17.3), do not edit directly.
Unused Definitions [overview]
This rule is a best-effort rule.
Finds definitions that are never used.
This linting rule is implemented in src/linter/rules/unused-definition.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The unused-definitions rule accepts the following configuration options:
-
excludeExportedDefinitions
Whether to suppress definitions that the analyzed project exports via itsNAMESPACE(the package's public API). flowR cannot observe external callers, so exported names would otherwise be reported as (uncertain) false positives. -
includeFunctionDefinitions
Whether to include (potentially anonymous) function definitions in the search (e.g., should we report uncalled anonymous functions?).
x <- 42
y <- 3
print(x)The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "unused-definitions", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (3 ms)
╰ Unused Definitions (unused-definitions):
╰ uncertain:
╰ Definition of y at 3.1 (1 quick fix(es) available)
More examples are the test cases in test/functionality/linter/lint-unused-definition.test.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information