Repository navigation
[Linting Rule] Dead Code
github-actions[bot] edited this page Nov 8, 2026
·
1 revision
Generated from 'wiki-linter.ts' on 2026-10-27, 10:46:55 UTC (v2.16.6), do not edit directly.
Dead Code [overview]
This rule is a best-effort rule.
Finds code that is never reached during execution.
This linting rule is implemented in src/linter/rules/dead-code.ts.
f <- function(x) {
return(x)
print("never reached")
}
if(TRUE) 1 else 2The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "dead-code", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (4 ms)
╰ Dead Code (dead-code):
╰ certain:
╰ Code at 4.2-23 (1 quick fix(es) available)
╰ Code at 6.17 (1 quick fix(es) available)
More examples are the test cases in test/functionality/linter/lint-dead-code.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