Skip to main content

fix-lint-errors

Fix lint errors by removing unused variables and imports rather than prefixing with underscore. Use when lint errors are reported, when fixing compilation issues, or when the user asks to fix lint errors.

설치로 이동

소스 정보

저장소
forcedotcom/apex-language-support
최근 소스 활동
2026년 4월 29일 18:44
감지된 SKILL.md 언어
영어
스타
11
포크
3

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
fix-lint-errors
description
Fix lint errors by removing unused variables and imports rather than prefixing with underscore. Use when lint errors are reported, when fixing compilation issues, or when the user asks to fix lint errors.
# Fix Lint Errors ## Core Principle When fixing lint errors, **remove unused code rather than suppressing it**. The first specific hint from the linter should guide the fix. ## Unused Variables **Rule**: Remove unused variables. Do not prefix them with `_` to suppress the warning. **Example - Correct:** ```typescript // Before (lint error: 'unusedVariable' is defined but never used) function processData(data: string) { const unusedVariable = 'test'; return data.toUpperCase(); } // After (removed unused variable) function processData(data: string) { return data.toUpperCase(); } ``` **Example - Incorrect:** ```typescript // ❌ Don't do this - don't prefix with underscore function processData(data: string) { const _unusedVariable = 'test'; // Wrong approach return data.toUpperCase(); } ``` ## Unused Imports Remove unused imports completely rather than leaving them in the code. **Example:** ```typescript // Before (lint error: 'unusedFunction' is imported but never used) import { usedFunction, unusedFunction } from './utils'; // After (removed unused import) import { usedFunction } from './utils'; ``` ## Workflow 1. **Read lint errors**: Check the specific lint error message 2. **Apply the first specific hint**: Follow the linter's suggestion if it's clear and specific 3. **Remove, don't suppress**: Delete unused code rather than prefixing with `_` or adding ignore comments 4. **Verify fix**: Run `npm run lint` to confirm the error is resolved ## Common Patterns ### Unused Function Parameters If a parameter is truly unused, remove it: ```typescript // Before function handler(event: Event, unusedParam: string) { return event.type; } // After function handler(event: Event) { return event.type; } ``` ### Unused Destructured Variables Remove unused destructured variables: ```typescript // Before const { used, unused } = getData(); // After const { used } = getData(); ``` ## When Suppression Might Be Acceptable Only use suppression patterns (`_` prefix or ignore comments) when: - The code is intentionally kept for future use (document why) - It's part of an interface/type that must match a signature - Removing it would break functionality In all other cases, **remove the unused code**.
GitHub에서 보기