Repository navigation
chore(Lint): extend FE linter rules - #8819
talissoncosta wants to merge 6 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8819 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 1683 1683
Lines 70275 70275
=======================================
Hits 69489 69489
Misses 786 786 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
e98bd409-bfda-4e80-a2be-77e13c8f5b5d
📒 Files selected for processing: 6
.github/workflows/frontend-pull-request.yml.husky/pre-commitfrontend/.eslintignorefrontend/.eslintrc.jsfrontend/bin/check-scss.jsfrontend/package.json
💤 Files with no reviewable changes: 1
- frontend/.eslintignore
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
…ching .dark-* Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Match template literals in the Bootstrap class restriction. · .eslintrc.js:26-64
frontend/.eslintrc.js:26-64
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMatch template literals in the Bootstrap class restriction.
The selector only matches
Literaldescendants. The reachableIdentityTraitsexample storesfont-weight-mediumin aTemplateElement, so the lint rule does not report this disallowed Bootstrap class.Suggested fix
- "JSXAttribute[name.name='className'] Literal[value=/(^|\\s)(font-weight-[a-z]+|float-(left|right)|text-(left|right)|[mp][lr]-([0-9]|auto))(\\s|$)/]", + "JSXAttribute[name.name='className'] :matches(Literal[value=/(^|\\s)(font-weight-[a-z]+|float-(left|right)|text-(left|right)|[mp][lr]-([0-9]|auto))(\\s|$)/], TemplateElement[value.raw=/(^|\\s)(font-weight-[a-z]+|float-(left|right)|text-(left|right)|[mp][lr]-([0-9]|auto))(\\s|$)/])",
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
bbd1d21e-4211-4191-b0cc-f7b7afbca308
📒 Files selected for processing: 2
frontend/.eslintrc.jsfrontend/bin/check-scss.js
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Docker builds report
|
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22654 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-16 — run #22654 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #22654 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #22654 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression24 screenshots compared. See report for details. |
Replaces bin/check-scss.js. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
70ace75 to
742715d
Compare
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #8832
Turns the review comments we keep repeating (see #8805) into lint rules, so review can focus on the change itself.
Only changed lines are checked, so the existing backlog doesn't block anyone. ESLint runs in CI and in the pre-commit hook; SCSS is checked in CI only. For a real exception, disable the rule on that line with a reason.
stylepropdata-test,byId,[data-test]locatorsgetByRole/getByLabelbtn-with-icon,<Button theme='icon'>IconButton.dark(not.dark-*) in added SCSS lines, via Stylelint and reviewdog_tokens.scss,_primitives.scss, docs exempt)iconLeft/iconRightrole='button'BareButtonasand!assertionsfetch(), includingwindow.fetchandglobalThis.fetchdangerouslySetInnerHTMLIonIconandioniconsIconAlso:
e2e/is no longer ignored by ESLint, so the selector rules apply there. Prettier and import alias stay off for it.LINT_STAGED, which switcheseslint-plugin-diffto staged mode. Before this, pre-commit linted whole files.How did you test this code?
as const,href='#section',ms-2andfw-bolddon't.PanelSearch.tsx(16 existing errors) commits fine, and a newstyleprop in it is blocked.OnboardingTerminal.scss(which already has 17 hex colours): the job failed with 2 annotations (the new hex and.dark),.dark-modeand the old hex were ignored. The commit was then dropped.IonIcon,ionicons,window.fetchandglobalThis.fetchare flagged;.dark-modein SCSS isn't.CI=true ESLINT_PLUGIN_DIFF_COMMIT=origin/main npm run lintpasses on this branch.