[code-scanning-fix] Fix js/unused-local-variable: Remove unused TSESTree import#46173
Conversation
Resolves CodeQL alert #645 (js/unused-local-variable). TSESTree was imported but never referenced in the rule implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Test Quality Sentinel completed test quality analysis. No test files were added or modified in this PR. This PR only modifies a TypeScript source file (eslint-factory/src/rules/require-fs-sync-try-catch.ts) to remove an unused import. Test Quality Sentinel analysis is not applicable. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #46173 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100). |
There was a problem hiding this comment.
Pull request overview
Removes an unused TypeScript ESLint import flagged by CodeQL.
Changes:
- Removed the unused
TSESTreeimport. - Preserved rule behavior.
Show a summary per file
| File | Description |
|---|---|
eslint-factory/src/rules/require-fs-sync-try-catch.ts |
Removes the unused import. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
There was a problem hiding this comment.
Correct and minimal fix. Removing the unused TSESTree import is safe — it is not referenced anywhere in the file, and the remaining import (ESLintUtils) is still used. No behavior change, no regression risk.
🔎 Code quality review by PR Code Quality Reviewer · 9.32 AIC · ⌖ 4.26 AIC · ⊞ 5.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs — change is correct and complete.
This is a clean, minimal fix: the unused TSESTree import is removed and nothing else changes. TypeScript will confirm correctness at compile time. No actionable issues found.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 12.6 AIC · ⌖ 4.27 AIC · ⊞ 6.7K
Comment /matt to run again
There was a problem hiding this comment.
LGTM. The change correctly removes the unused TSESTree named import while keeping ESLintUtils. One-line, no behaviour change, no issues found.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 11.6 AIC · ⌖ 4.25 AIC · ⊞ 5K
Summary
Removes the unused
TSESTreeimport fromeslint-factory/src/rules/require-fs-sync-try-catch.ts, fixing ajs/unused-local-variablecode scanning alert.Changes
eslint-factory/src/rules/require-fs-sync-try-catch.tsTSESTreenamed import from@typescript-eslint/utilsDetails
TSESTreewas imported alongsideESLintUtilsbut never referenced in the file. OnlyESLintUtilsis needed. This is a no-op change that does not affect runtime behaviour or ESLint rule logic.Motivation
Fixes a GitHub code scanning (
js/unused-local-variable) alert raised for this file.