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: full rule key, e.g. @sentry/scraps/no-manual-table or @sentry/prefer-nuqs
  • $1: repository-relative path prefix, e.g. static/app/views/alerts/

If $0 is empty, ask for the rule. If $1 is empty, the scope is the whole repository: the commands below then lint and list every file.

Linting runs through pnpm run lint:js, which always applies the committed config and rejects rule overrides (-A, -W, -D, --config). To find a rule's violations, the rule has to be in the config.

Step 1: Find Where the Rule Stands

Search for $0 in oxlint.config.ts, oxlint.base.ts, and the package configs in static/packages/*/oxlint.config.ts. Configs can pull rules in through spread constants from oxlint.base.ts: incubator enables @sentry/prefer-fake-timers and @sentry/require-fake-timer-cleanup only through ...fakeTimerRules. If $0 only turns up in such a constant, check whether that constant is spread into incubator.

Where the rule isIts violationsNext
incubator at the top of oxlint.config.ts: in incubator.rules or enabled in incubator.overridesCapped per file in oxlint-suppressions.json (static/app/, static/gsApp/, static/gsAdmin/)Step 2
In no config (only in the plugin's index)UnreportedRegister it first; see below.
Anywhere else (base, top-level rules, overrides)No existing backlog: pnpm run lint:js fails CI on every violationFix any new violations on your branch (Step 3, regular rule); there is no backlog to clean up

To register an unconfigured rule, count its violations first: enable it in top-level rules in oxlint.config.ts and run pnpm run lint:js, which prints the total. Then follow Step 3 of the lint-new skill:

  • Few enough to fix in this PR: keep it as a regular rule.
  • More than that: move it to incubator and enroll it (Step 4 of lint-new, pnpm run lint:suppressions --enroll --base origin/master).

Step 2: Understand the Fix

The rule's error message names the replacement. For anything it leaves open, read the rule source and the valid cases in its spec. The plugin index imports each rule from its source file, usually <camelName>.ts next to <camelName>.spec.ts (some rules share a file, e.g. emotionRules.ts):

  • Scraps: static/oxlint/eslintPluginScraps/src/rules/index.ts
  • Sentry: static/oxlint/eslintPluginSentry/index.ts

references/fix-patterns.md has worked fixes for every incubator rule and for the Scraps rules with manual fixes. For an incubator rule, you MUST load it. For use-semantic-token, you MUST load references/token-taxonomy.md.

The rule is autofixable when its meta sets fixable.

Step 3: List the Violations

Incubator rule. pnpm run lint:js hides violations the budgets cover, so list them with the backlog instead:

pnpm run lint:suppressions --backlog --rule $0 | grep '^$1'     # file:line:col rule message
pnpm run lint:suppressions --backlog --rule $0 | grep -c '^$1'  # count

The backlog takes no path and scans the whole repository (about 30 seconds), so filter its output. It leaves out lines with an oxlint-disable comment for the rule. Those are deliberate exceptions: don't fix them or remove their comments, even when you find them by searching. Narrow to one file with --file <path>, or get JSON with --json.

Regular rule (just enabled for a small fix):

pnpm run lint:js $1

A regular rule fails CI on every violation, so it must end up clean across the whole repository, not just under $1.

Step 4: Choose a Strategy

Violations in scopeStrategy
Any, autofixablepnpm run lint:js --fix $1. This applies every autofixable rule on those files, not only $0, so review the diff. Fix whatever it leaves by hand.
Under 100Fix by hand, 5-10 files at a time, re-listing after each batch
100-500Split $1 into subdirectories and fix one per batch or PR
500+A throwaway codemod for mechanical transforms, or several PRs split by owner while the rule stays in the incubator

Step 5: Lower the Budgets

Only for incubator rules. Once violations are fixed, the budgets for those files are stale, and pnpm run lint:suppressions --ci --base <ref> fails CI on stale budgets your change made. Lower them:

pnpm run lint:suppressions --prune

Commit the updated oxlint-suppressions.json files. A successful pnpm run lint:js --fix <paths> already lowers budgets for the files it checked, but run --prune anyway before you commit.

Step 6: Graduate the Rule

Only when the backlog for $0 is empty everywhere, not just under $1:

  1. Move every entry for $0 out of incubator into the regular config (where it goes follows the lint-new skill's Step 3 table):

    • An entry in incubator.rules moves to the regular config.
    • An enabled entry in incubator.overrides moves to a regular overrides entry with the same files. For example, @sentry/prefer-fake-timers and @sentry/require-fake-timer-cleanup are enabled only through fakeTimerRules in the test-files override. Test-only rules go in testOverride in oxlint.base.ts.
    • An off entry in incubator.overrides moves to a matching regular overrides entry.

    The rule leaves the incubator only when no enabled entry for it remains anywhere in incubator.

  2. Run pnpm run lint:suppressions --prune; it drops the rule's remaining budget entries.

Verify

Done when all of these pass:

pnpm run lint:js $1
pnpm run typecheck
.venv/bin/prek run -q --files <changed files>

For an incubator rule, also:

pnpm run lint:suppressions --ci --base origin/master            # without --base, stale budgets only warn
pnpm run lint:suppressions --backlog --rule $0 | grep -c '^$1'   # 0

For a regular rule, or after graduating the rule, run pnpm run lint:js with no path. --backlog --rule only accepts incubator rules.

Coordinating Large Changes

  • Split PRs to ~50 changed files, grouped by owner in .github/CODEOWNERS.
  • PR title: fix(lint): Fix $0 violations for <owner>.
  • Each PR carries its own pruned oxlint-suppressions.json changes.

sentry의 다른 스킬

add-ai-integration
sentry
Sentry JavaScript SDK에 새로운 AI 제공자 통합을 추가합니다. 새로운 AI 계측(OpenAI, Anthropic, Vercel AI, LangChain 등)을 기여할 때 사용하세요.
add-cdn-bundle
sentry
지정된 기능을 사용하여 브라우저 패키지용 새 CDN 번들을 생성합니다.
agent-prompt
sentry
효과적인 에이전트 프롬프트와 스킬 작성을 위한 참고 가이드입니다. 새로운 스킬을 만들거나 프롬프트 품질을 검토하거나 Warden의 프롬프트를 이해할 때 사용하세요.
agents-md
sentry
이 스킬은 사용자가 "AGENTS.md 생성", "AGENTS.md 업데이트", "에이전트 문서 유지", "CLAUDE.md 설정"을 요청하거나 에이전트를 유지해야 할 때 사용해야 합니다.
agents-md
sentry
60줄 미만의 최소화되고 핵심 정보를 담은 에이전트 문서를 생성 및 유지 관리합니다. 연구 기반의 에이전트 문서 모범 사례를 적용하며, 길이가 길어질수록 지침 품질이 저하됩니다. 패키지 관리자, 파일 범위 명령(파일별 테스트/린트/타입체크), 에이전트 ID를 포함한 커밋 속성의 세 가지 핵심 섹션이 필요합니다. 프로젝트 구조(잠금 파일, 린터 설정, CI 명령, 모노레포 표시)를 분석하여 파일에 포함할 내용을 결정합니다. 헤더와 불릿만 사용하며, 참조...
agents-md
sentry
이 스킬은 사용자가 "create AGENTS.md", "update AGENTS.md", "maintain agent docs", "set up CLAUDE.md"를 요청하거나 에이전트 문서를 유지해야 할 때 사용해야 합니다.
ai-sdk
sentry
ai-sdk — AI 에이전트용 설치 가능한 스킬, getsentry/webvitals.com에서 게시함.
analytics
sentry
Sentry의 프론트엔드 UI에서 analytics 이벤트를 계측하고 발견합니다. 버튼, 페이지, 모달 또는 사용자 정의 상호작용에 추적을 추가하거나 새로운 항목을 정의할 때 사용합니다.