Repository navigation
chore(Lint): extend FE linter rules - #8819
talissoncosta wants to merge 4 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.
|
📝 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.
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, in CI and now also in the pre-commit hook, so the existing backlog doesn't block anyone. 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 changed SCSS lines_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, a newstyleprop in it is blocked, and a hex in_buttons.scssis blocked.IonIcon,ionicons,window.fetchandglobalThis.fetchare flagged;.dark-modein SCSS isn't.CI=true ESLINT_PLUGIN_DIFF_COMMIT=origin/main npm run lintandSCSS_DIFF_BASE=origin/main npm run lint:scsspass on this branch.