rubocop
rubocop copied to clipboard
False negative for `Lint/UselessAssignment`
Consider
x = 1
x = 2
foo {
x = 3
}
Lint/UselessAssignment doesn't register any offenses, even though the first assignment is useless. Assignment inside the block seems to confuse the cop.
1.66.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, running on ruby 3.3.2) [x86_64-darwin21]
- rubocop-factory_bot 2.26.1
- rubocop-minitest 0.36.0
- rubocop-performance 1.22.1
- rubocop-rails 2.26.2