Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 24, 2025

This PR switches the project from ESLint to oxlint, a Rust-based linter that provides dramatically faster performance while maintaining compatibility with most ESLint rules.

Performance Improvements

  • Linting speed: ~2ms (extremely fast) vs previous ESLint setup
  • Rule coverage: 127 active rules across TypeScript, React, Unicorn, and OXC plugins
  • Multi-threaded: 4-threaded execution for optimal performance

Changes Made

Dependencies

  • Removed: eslint, @eslint/js, eslint-plugin-react-hooks, eslint-plugin-react-refresh, typescript-eslint, globals
  • Added: oxlint v1.12.0 in root devDependencies for monorepo consistency

Configuration

  • Created .oxlintrc.json at package root for centralized monorepo configuration
  • Configured plugins for:
    • TypeScript: TypeScript-specific linting rules
    • React: React best practices and JSX rules
    • Unicorn: Additional code quality rules
    • OXC: Unique optimization rules from the OXC project
  • Configured react/react-in-jsx-scope: off for modern React with new JSX transform
  • Added dist to ignore patterns

Scripts & Workflow

  • Centralized lint command: Moved from dashboard-specific to root workspace command oxlint .
  • Simplified configuration: oxlint automatically picks up .oxlintrc.json from root
  • Removed: dashboard-specific lint script and config path references
  • All existing workflow commands (pnpm lint, pnpm build) work unchanged

Documentation

  • Updated README files to reflect the switch to oxlint
  • Added performance metrics and configuration guidance
  • Removed outdated ESLint configuration examples

Validation

✅ All lint rules pass with 0 warnings/errors
✅ Build process works unchanged
✅ Development server starts normally
✅ Error detection confirmed (tested with intentional code issues)
✅ Centralized configuration works across monorepo
✅ Root workspace linting command functional

The switch maintains all existing code quality standards while providing significantly faster feedback during development and proper monorepo organization with centralized commands.

Fixes #17.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] switch eslint to oxlint Replace ESLint with oxlint for significantly faster linting performance Aug 24, 2025
Copilot AI requested a review from Boshen August 24, 2025 12:08
@Boshen Boshen marked this pull request as ready for review August 24, 2025 14:23
@Boshen
Copy link
Member

Boshen commented Aug 24, 2025

@copilot move apps/dashboard/.oxlintrc.json to the package root, along with relevant commands.

Copy link
Contributor Author

Copilot AI commented Aug 24, 2025

@copilot move apps/dashboard/.oxlintrc.json to the package root, along with relevant commands.

Done! I've moved .oxlintrc.json to the package root and updated the relevant commands:

  • Configuration: Moved apps/dashboard/.oxlintrc.json.oxlintrc.json (root)
  • Dependencies: Moved oxlint from dashboard to root devDependencies for monorepo consistency
  • Commands: Updated dashboard lint script to reference root config: oxlint --config ../../.oxlintrc.json .
  • Verification: Confirmed linting works from both root (pnpm lint) and dashboard directory

The change maintains the same fast performance (2ms, 127 rules, 4 threads) while centralizing configuration for the monorepo. Commit: ab3e8cf

"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint": "oxlint --config ../../.oxlintrc.json .",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot move this command to package root as workspace command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I've moved the lint command to the package root as a workspace command:

  • Root package.json: Changed from "lint": "pnpm -r lint" to "lint": "oxlint ."
  • Dashboard package.json: Removed the dashboard-specific lint script
  • Simplified: oxlint automatically picks up .oxlintrc.json from root, no config path needed

All commands work unchanged (pnpm lint, pnpm build, pnpm build-deploy) with the same fast performance. Commit: cd1a110

Copilot AI requested a review from Boshen August 24, 2025 14:50
@Boshen Boshen merged commit 92d665f into main Aug 24, 2025
1 check passed
@Boshen Boshen deleted the copilot/fix-17 branch August 24, 2025 14:52
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.

switch eslint to oxlint

2 participants