Skip to content

[Feature] Add @studiometa/eslint-plugin-ui package#503

Open
titouanmathis wants to merge 4 commits intomainfrom
feat/eslint-plugin
Open

[Feature] Add @studiometa/eslint-plugin-ui package#503
titouanmathis wants to merge 4 commits intomainfrom
feat/eslint-plugin

Conversation

@titouanmathis
Copy link
Copy Markdown
Contributor

@titouanmathis titouanmathis commented May 7, 2026

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Adds a new @studiometa/eslint-plugin-ui package with ESLint rules to help developers discover and use components from @studiometa/ui rather than reimplementing them from scratch.

Rules included:

Rule Description
ui/prefer-ui-component Warn when a class named after a @studiometa/ui component (e.g. Menu, Accordion) extends Base directly instead of importing from the library
ui/prefer-transition Warn when a Base subclass manually implements open() and close() — suggest Transition
ui/no-manual-fetch Warn when a Base subclass combines fetch() with DOM injection — suggest the Fetch component
ui/prefer-data-model Warn when a Base subclass manually syncs input values to the DOM — suggest DataModel/DataEffect
ui/prefer-action Warn when a Base subclass only defines a single simple event handler — suggest Action

All rules are included in the recommended config at warn severity.

Also fixes a deprecated moduleResolution: node value in the root tsconfig.json.

📝 Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.
  • I have updated the changelog.

@titouanmathis titouanmathis changed the title Add @studiometa/eslint-plugin-ui package [Feature] Add @studiometa/eslint-plugin-ui package May 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Export Size

Unchanged

@studiometa/ui

Name Size Diff
AbstractFrameTrigger 1.74 kB -
AbstractPrefetch 366 B -
AbstractScrollAnimation 3.66 kB -
AbstractSliderChild 600 B -
Accordion 1.77 kB -
AccordionItem 1.75 kB -
Action 1.11 kB -
AnchorNav 3.85 kB -
AnchorNavLink 3.74 kB -
AnchorNavTarget 125 B -
AnchorScrollTo 2.53 kB -
animationScrollWithEase 763 B -
CircularMarquee 550 B -
Cursor 650 B -
DataBind 697 B -
DataComputed 856 B -
DataEffect 837 B -
DataModel 780 B -
Draggable 1.64 kB -
Fetch 2.34 kB -
Figure 1.72 kB -
FigureShopify 1.98 kB -
FigureTwicpics 2.26 kB -
FigureVideo 1.87 kB -
FigureVideoTwicpics 2.44 kB -
Frame 3.47 kB -
FrameAnchor 1.84 kB -
FrameForm 1.92 kB -
FrameLoader 1.45 kB -
FrameTarget 1.75 kB -
FrameTriggerLoader 1.46 kB -
Hoverable 953 B -
LargeText 713 B -
LazyInclude 322 B -
Menu 2.33 kB -
MenuBtn 140 B -
MenuList 1.9 kB -
Modal 1.99 kB -
ModalWithTransition 2.09 kB -
Panel 2.38 kB -
PrefetchWhenOver 408 B -
PrefetchWhenVisible 417 B -
ScrollAnimation 3.79 kB -
ScrollAnimationChild 3.91 kB -
ScrollAnimationChildWithEase 4.51 kB -
ScrollAnimationParent 3.98 kB -
ScrollAnimationTarget 3.85 kB -
ScrollAnimationTimeline 3.92 kB -
ScrollAnimationWithEase 4.39 kB -
ScrollReveal 1.63 kB -
Sentinel 129 B -
Slider 2.3 kB -
SliderBtn 817 B -
SliderCount 650 B -
SliderDots 1.86 kB -
SliderDrag 269 B -
SliderItem 998 B -
SliderProgress 961 B -
Sticky 771 B -
Tabs 1.38 kB -
Target 86 B -
Transition 1.41 kB -
withDeprecation 166 B -
withScrollAnimationDebug 2.04 kB -
withTransition 1.39 kB -

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 88.73874% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.99%. Comparing base (0add627) to head (6e1d3c4).

Files with missing lines Patch % Lines
packages/eslint-plugin-ui/src/utils/ast.ts 74.57% 8 Missing and 7 partials ⚠️
...es/eslint-plugin-ui/src/rules/prefer-data-model.ts 93.87% 3 Missing ⚠️
...ckages/eslint-plugin-ui/src/rules/prefer-action.ts 95.34% 2 Missing ⚠️
...es/eslint-plugin-ui/src/rules/prefer-transition.ts 84.61% 2 Missing ⚠️
.../eslint-plugin-ui/src/rules/prefer-ui-component.ts 84.61% 2 Missing ⚠️
...ages/eslint-plugin-ui/src/rules/no-manual-fetch.ts 97.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #503      +/-   ##
============================================
+ Coverage     72.64%   73.99%   +1.34%     
  Complexity      145      145              
============================================
  Files            85       92       +7     
  Lines          2435     2657     +222     
  Branches        357      445      +88     
============================================
+ Hits           1769     1966     +197     
- Misses          584      602      +18     
- Partials         82       89       +7     
Flag Coverage Δ
unittests 73.99% <88.73%> (+1.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/eslint-plugin-ui/src/utils/rule-tester.ts 100.00% <100.00%> (ø)
...ages/eslint-plugin-ui/src/rules/no-manual-fetch.ts 97.50% <97.50%> (ø)
...ckages/eslint-plugin-ui/src/rules/prefer-action.ts 95.34% <95.34%> (ø)
...es/eslint-plugin-ui/src/rules/prefer-transition.ts 84.61% <84.61%> (ø)
.../eslint-plugin-ui/src/rules/prefer-ui-component.ts 84.61% <84.61%> (ø)
...es/eslint-plugin-ui/src/rules/prefer-data-model.ts 93.87% <93.87%> (ø)
packages/eslint-plugin-ui/src/utils/ast.ts 74.57% <74.57%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant