Skip to content

feat: updated scope analyzer to mark variables as used to prevent false positives with no-useless-assignment - #288

Merged
ota-meshi merged 3 commits into
masterfrom
no-useless-assignment
Feb 14, 2026
Merged

ota-meshi merged 3 commits into
masterfrom
no-useless-assignment

Conversation

@ota-meshi

Copy link
Copy Markdown
Member

close #287

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #287 by fixing false positives with ESLint 10's no-useless-assignment rule when variables are used in Vue templates. The core change marks all template-referenced variables as eslintUsed, not just type references, ensuring ESLint recognizes these as legitimate variable uses.

Changes:

  • Updated scope analyzer to mark all template-used variables as eslintUsed, preventing false positives with no-useless-assignment and @typescript-eslint/no-unused-vars
  • Modernized test infrastructure by removing ESLint compatibility layer and adding version-aware test handling
  • Created separate test fixtures for ESLint v8 and v10 to ensure backward compatibility

Reviewed changes

Copilot reviewed 41 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/script-setup/scope-analyzer.ts Removed conditional check - now marks all template-used variables as eslintUsed instead of only type references
test/lib/eslint-compat.ts Deleted ESLint v6 compatibility shim, no longer needed
test/integrations.test.ts Updated to use ESLint directly with version-aware test skipping logic
test/fixtures/integrations/script-setup/package.json Updated to require ESLint v10
test/fixtures/integrations/script-setup/eslint.config.js Added flat config for ESLint 10+ with no-useless-assignment rule enabled
test/fixtures/integrations/script-setup/output.json Added expected error output for no-useless-assignment test cases
test/fixtures/integrations/script-setup/no-useless-assignment/* Added test cases for valid and invalid no-useless-assignment scenarios
test/fixtures/integrations/script-setup-with-eslint-v8/* Created new test fixture directory for ESLint v8 backward compatibility testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integrations.test.ts Resolved
Comment thread test/integrations.test.ts Resolved
Comment thread test/integrations.test.ts Resolved
Comment thread test/integrations.test.ts Resolved
@ota-meshi
ota-meshi merged commit 20c2ed3 into master Feb 14, 2026
9 checks passed
@ota-meshi
ota-meshi deleted the no-useless-assignment branch February 14, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template var refereneces are not marked as eslintUsed

2 participants