Repository navigation
feat: updated scope analyzer to mark variables as used to prevent false positives with no-useless-assignment - #288
Merged
Merged
Conversation
…se positives with `no-useless-assignment`
Contributor
There was a problem hiding this comment.
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 withno-useless-assignmentand@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.
Closed
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #287