Commit f825104
committed
feat(linter): add redundancy rules for literal returns and inline variables
- Add `no-redundant-literal-return` rule to detect patterns like `if ($x === null) { return null; } return $x;`
- Add `inline-variable-return` rule to detect patterns like `$x = getValue(); return $x;`
Signed-off-by: azjezz <[email protected]>1 parent 5227a25 commit f825104
File tree
6 files changed
+1270
-0
lines changed- crates/linter/src
- rule
- redundancy
- docs/tools/linter/rules
6 files changed
+1270
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| 231 | + | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
| |||
0 commit comments