This guide gets you up and running with both the ESLint plugin and UI component library in your Gadget project.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aurelienbobenrieth/gadget/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before starting, make sure you have:- Node.js 18 or higher
- A Gadget project with action files
- Basic familiarity with ESLint configuration
ESLint Plugin Setup
Configure ESLint
Create or update your
eslint.config.js with the recommended preset:eslint.config.js
The plugin automatically activates on Gadget action files:
**/api/actions/**/*.{js,ts} and **/api/models/**/actions/**/*.{js,ts}Run ESLint
Validate your action files:If you have any validation errors, ESLint will report them with fixable suggestions.
Example: Fixing a validation error
Hereโs what you might see when running ESLint on an action file:api/models/widget/actions/create.ts
eslint . --fix, the file is corrected:
api/models/widget/actions/create.ts
UI Components Setup
Import global styles
Add the global CSS to your main CSS file or root layout:This imports CSS variables for colors, shadows, typography, and theme support.
styles/globals.css
Example: Theme switching
Toggle between dark and light themes by setting thedata-theme attribute on your root element:
app/theme-toggle.tsx
Next Steps
Now that you have both packages installed, explore the documentation:ESLint Rules
Browse all 16 validation rules organized by category
Component Library
Explore the full component API with examples
Configuration
Learn advanced ESLint configuration options
Design Tokens
Customize colors, typography, and theme behavior
Common Issues
ESLint doesn't validate my action files
ESLint doesn't validate my action files
Make sure your action files match the expected patterns:
**/api/actions/**/*.{js,ts}for global actions**/api/models/**/actions/**/*.{js,ts}for model actions
Tailwind classes aren't working
Tailwind classes aren't working
Ensure you:
- Added the Gadget preset to
tailwind.config.js - Included the UI package dist folder in your
contentarray - Imported the global styles in your CSS entry point
pnpm run build in the UI package if using local development.Components don't have proper theming
Components don't have proper theming
Check that:
- You imported
@aurelienbbn/gadget-ui/stylesin your global CSS - Your root HTML element has the
data-themeattribute set to โdarkโ or โlightโ - Your Tailwind config uses the Gadget preset (not a custom config)
Get Help
If you encounter issues:- Check the ESLint Plugin Configuration guide
- Review the UI Setup documentation
- Open an issue on GitHub
