Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"plugins": [
"unicorn",
"typescript",
"oxc",
"react"
],
"categories": {
"correctness": "warn",
"suspicious": "warn"
},
"rules": {
"react/react-in-jsx-scope": "off"
},
"settings": {
"jsx-a11y": {
"polymorphicPropName": null,
"components": {},
"attributes": {}
},
"react": {
"formComponents": [],
"linkComponents": []
},
"jsdoc": {
"ignorePrivate": false,
"ignoreInternal": false,
"ignoreReplacesDocs": true,
"overrideReplacesDocs": true,
"augmentsExtendsReplacesDocs": false,
"implementsReplacesDocs": false,
"exemptDestructuredRootsFromChecks": false,
"tagNamePreference": {}
}
},
"env": {
"builtin": true
},
"globals": {},
"ignorePatterns": ["dist"]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ A modern frontend dashboard for displaying different metrics using bar charts.

## ⚡ Performance

The dashboard uses **rolldown-vite** for significantly faster build times:
- **Build Performance**: ~13.8x faster builds (309ms vs 4.28s)
The dashboard uses **rolldown-vite** for significantly faster build times and **oxlint** for ultra-fast linting:
- **Build Performance**: ~13.8x faster builds (309ms vs 4.28s) with Rolldown
- **Linting Performance**: Extremely fast linting (~2ms) with oxlint
- **Development**: Fast startup (306ms) with Rolldown's Rust-based bundler
- **Hot Module Replacement**: Instant updates during development

Expand Down
68 changes: 14 additions & 54 deletions apps/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,29 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and fast linting using oxlint.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration
## Oxlint Configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
This project uses [oxlint](https://oxc.rs) for linting, which provides significantly faster performance than ESLint while maintaining compatibility with most ESLint rules.

```js
export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
The configuration is in `.oxlintrc.json` and includes:
- TypeScript plugin for TypeScript-specific rules
- React plugin for React best practices
- Unicorn plugin for additional code quality rules
- OXC plugin for unique optimization rules

// Remove tseslint.configs.recommended and replace with this
...tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
...tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
...tseslint.configs.stylisticTypeChecked,

// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
To run linting:
```bash
pnpm lint
```

You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
To customize the configuration, edit `.oxlintrc.json`. Oxlint supports most ESLint configuration options.

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default tseslint.config([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
```
23 changes: 0 additions & 23 deletions apps/dashboard/eslint.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"clean": "rm -rf dist"
},
Expand All @@ -17,15 +16,9 @@
"lucide-react": "^0.414.0"
},
"devDependencies": {
"@eslint/js": "^9.33.0",
"@types/react": "^19.1.10",
"@types/react-dom": "^19.1.7",
"eslint": "^9.33.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"typescript": "~5.8.3",
"typescript-eslint": "^8.39.1",
"rolldown-vite": "^7.1.3"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "pnpm --filter dashboard dev",
"build": "pnpm -r build",
"lint": "pnpm -r lint",
"lint": "oxlint .",
"test": "pnpm -r test",
"clean": "pnpm -r clean",
"build-deploy": "pnpm lint && pnpm build"
Expand All @@ -16,6 +16,7 @@
"license": "MIT",
"devDependencies": {
"@types/node": "^20.0.0",
"oxlint": "^1.12.0",
"typescript": "^5.0.0"
},
"packageManager": "[email protected]"
Expand Down
Loading