lint-fix

작성자: sentry

코드베이스 전반에 걸쳐 eslintPluginScraps 규칙 위반을 수정합니다. "린트 위반 수정", "린트 규칙 적용", "스크랩 규칙 오류 수정", "롤…"과 같은 요청이 있을 때 사용합니다.

npx skills add https://github.com/getsentry/sentry --skill lint-fix

Fix violations of rule $0 on files matching $1.

Arguments

  • $0 — Rule name (e.g., use-semantic-token, no-core-import)
  • $1 — File or glob pattern (e.g., static/app/components/, static/app/views/alerts/)

Step 1: Understand the Rule

Before fixing violations, know what the fix looks like. Load references/fix-patterns.md for per-rule fix details:

RuleHas autofix?Fix reference
no-core-importYesfix-patterns.md §no-core-import
no-token-importNofix-patterns.md §no-token-import
use-semantic-tokenNofix-patterns.md + token-taxonomy.md
restrict-jsx-slot-childrenNofix-patterns.md §restrict-jsx-slot-children

For use-semantic-token violations, you MUST load references/token-taxonomy.md to know which token category to use for each CSS property.

Step 2: Assess Scale

Count violations before choosing a strategy:

pnpm exec eslint --rule '@sentry/scraps/$0: error' "$1" 2>&1 | tail -5

The last line shows the count (e.g., "42 problems (42 errors, 0 warnings)").

Tip: Running eslint on all of static/app/ can take 2+ minutes. Narrow scope to a subdirectory first.

Step 3: Choose Strategy

Auto-fixable rule (any scale)

pnpm exec eslint --fix --rule '@sentry/scraps/$0: error' "$1"

Always review the diff after --fix before committing. If the rule is partially auto-fixable, run --fix first, then manually fix remaining violations.

Under 100 violations — manual agent fix

  1. Run eslint on target path
  2. Fix violations 5-10 files at a time
  3. Re-run after each batch to verify
  4. Repeat until clean

100-500 violations — batched fix

  1. Split target into subdirectories (e.g., static/app/views/, static/app/components/)
  2. Fix one subdirectory at a time
  3. Commit after each batch for reviewable PRs
  4. Re-run count after each batch to track progress

500+ violations — codemod or staged rollout

  • Mechanical transforms: write a temporary jscodeshift codemod or a targeted script using @typescript-eslint/typescript-estree
  • Import-path rules: --fix usually handles these at any scale
  • Complex transforms: enable the rule as warn first, fix in batches across multiple PRs

Fix Workflow (tight loop)

  1. Run: pnpm exec eslint --rule '@sentry/scraps/$0: error' "$1"
  2. Fix violations in reported files
  3. Re-run on changed files to verify
  4. Expand scope, repeat

Coordinating Large Changes

  • Split PRs to ~50 changed files based on ownership rules in @.github/CODEOWNERS.
  • PR title convention: fix(lint): enforce @sentry/scraps/$0 for <codeowner>
  • If the rule is new and not yet in eslint.config.ts, fix all violations first, then enable the rule in a follow-up PR
  • Run pre-commit on changed files before committing:
    .venv/bin/prek run -q --files <file1> [file2 ...]
    

Verification

After all fixes:

pnpm exec eslint --rule '@sentry/scraps/$0: error' static/app/ 2>&1 | tail -5

Should report 0 problems.

sentry의 다른 스킬

generate-frontend-forms
sentry
Sentry의 새로운 폼 시스템을 사용하여 폼을 생성하는 가이드입니다. 폼, 폼 필드, 유효성 검사 또는 자동 저장 기능을 구현할 때 사용하세요.
official
sentry-snapshots-cocoa
sentry
Apple/Cocoa 프로젝트를 위한 전체 Sentry Snapshots 설정입니다. "SnapshotPreviews 설정", "Apple 스냅샷 테스트 설정", "Apple 스냅샷 업로드" 요청 시 사용하세요.
official
architecture-review
sentry
직원 수준의 코드베이스 건강 검토. 모놀리식 모듈, 무음 실패, 타입 안전성 격차, 테스트 커버리지 구멍, LLM 친화성 문제를 찾습니다.
official
linear-type-labeler
sentry
Linear 이슈를 분류하고, 각 이슈의 제목과 설명 내용을 기반으로 Sentry 워크스페이스의 레이블 분류 체계에서 Type 레이블을 적용합니다.
official
sentry-flutter-sdk
sentry
Flutter 및 Dart를 위한 완전한 Sentry SDK 설정입니다. "Flutter에 Sentry 추가", "sentry_flutter 설치", "Dart에서 Sentry 설정" 또는 오류 구성을 요청받았을 때 사용하세요.
official
sentry-svelte-sdk
sentry
Svelte 및 SvelteKit을 위한 완전한 Sentry SDK 설정입니다. "Svelte에 Sentry 추가", "SvelteKit에 Sentry 추가", "@sentry/sveltekit 설치" 또는 구성 요청 시 사용하세요.
official
vercel-react-best-practices
sentry
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js 코드를 작성, 검토 또는 리팩토링할 때 사용해야 합니다.
official
sentry-tanstack-start-sdk
sentry
TanStack Start React용 전체 Sentry SDK 설정. "TanStack Start에 Sentry 추가", "@sentry/tanstackstart-react 설치" 또는 오류 구성 요청 시 사용…
official