Fix violations of an eslintPluginScraps rule across the codebase. Use when asked to "fix lint violations", "apply a lint rule", "fix scraps rule errors", "roll out a lint rule", "enforce a rule codebase-wide", or "fix design system lint". Covers manual fixes, autofix, batching, and codemod strategies for large-scale rollouts.
Fix violations of rule $0 on files matching $1.
$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/)Before fixing violations, know what the fix looks like. Load references/fix-patterns.md for per-rule fix details:
| Rule | Has autofix? | Fix reference |
|---|---|---|
no-core-import | Yes | fix-patterns.md §no-core-import |
no-token-import | No | fix-patterns.md §no-token-import |
use-semantic-token | No | fix-patterns.md + token-taxonomy.md |
restrict-jsx-slot-children | No | fix-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.
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.
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.
static/app/views/, static/app/components/)@typescript-eslint/typescript-estree--fix usually handles these at any scalewarn first, fix in batches across multiple PRspnpm exec eslint --rule '@sentry/scraps/$0: error' "$1"fix(lint): enforce @sentry/scraps/$0 for <codeowner>eslint.config.ts, fix all violations first, then enable the rule in a follow-up PR.venv/bin/pre-commit run --files <file1> [file2 ...]
After all fixes:
pnpm exec eslint --rule '@sentry/scraps/$0: error' static/app/ 2>&1 | tail -5
Should report 0 problems.