feat: migrate to oxlint & oxfmt and enforce code quality via Husky
📋 Overview
This Merge Request introduces a complete upgrade of the linting and formatting system by replacing the existing ESLint/Prettier setup with oxlint and oxfmt (Rust-based tools).
In addition, Husky pre-commit hooks are integrated to enforce code quality locally before any commit is allowed.
This significantly improves:
- Performance (faster linting)
- Code consistency
- Developer workflow automation
❗ Problem
The existing setup had several limitations:
- ESLint + Prettier were slower on larger codebases
- No strict enforcement before commits
- Inconsistent formatting across developers
- Code quality issues reaching CI/CD stage
🎯 Scope of This MR
This MR focuses on:
- Migrating linting and formatting tools
- Enforcing local code quality checks
- Updating CI/CD and documentation
It does not introduce new UI or feature-level changes.
🛠 ️ Changes Made
🔹 1. Removed ESLint Setup
-
Uninstalled:
eslint- TypeScript ESLint plugins
-
Removed configuration:
.eslintrc.js
🔹 2. Added oxlint & oxfmt
-
Installed:
-
oxlint→ linting -
oxfmt→ formatting
-
-
Added configuration file:
oxlint.json
Configuration includes:
- Custom linting rules
- Path exclusions (node_modules, build files, etc.)
🔹 3. Updated package.json Scripts
Added standardized scripts:
npm run lint # runs oxlint
npm run lint:fix # auto-fix lint issues
npm run format # runs oxfmt
🔹 4. Pre-commit Hooks (Husky)
- Initialized Husky
- Added
.husky/pre-commit
Behavior:
Before every commit:
npm run lint
npm run format
- Unformatted code
- Lint errors from entering repo
🔹 5. CI/CD Pipeline Updates
-
Updated
.gitlab-ci.yml:-
Added:
chore/setup-oxlint-format
-
-
Ensures:
- Linting runs in pipeline
- CI respects new tooling setup
🔹 6. Codebase Formatting
-
Applied:
- Repo-wide formatting using oxfmt
- Auto-fixed lint issues
-
Remaining issues:
-
Marked using:
// TODO: (lint) -
~6 warnings left for manual review
-
🔹 7. Documentation Updates
-
Updated:
PROJECT_SETUP_GUIDE.md
Includes:
- New tool setup
- Commands
- Workflow instructions
- Troubleshooting steps
🧪 Testing & Verification
-
✅ Verifiednpm run lintworks correctly -
✅ Verifiednpm run formatformats codebase -
✅ Husky pre-commit hook tested successfully -
✅ GitLab pipeline triggers and runs correctly -
✅ No conflicts with previous linting setup
📊 Impact
-
⚡ Faster linting (Rust-based tools) - 🧹 Cleaner, consistent codebase
-
🚫 Prevents bad commits before they happen -
🔁 Reduces review-time formatting fixes -
👩 💻 Improves developer experience
⚠ ️ Notes
-
Minor remaining lint warnings are intentionally left for manual review
-
ESLint is fully removed to avoid conflicts
-
Developers must run:
npm installafter pulling changes
🔍 Suggested Reviewer Focus
- Correct integration of Husky hooks
- oxlint rule configuration (
oxlint.json) - CI/CD pipeline behavior
- Script correctness in
package.json
📁 Files Changed
package.jsonoxlint.json.husky/pre-commit.gitlab-ci.ymlPROJECT_SETUP_GUIDE.md
✅ Checklist
-
Linting setup migrated to oxlint -
Formatting setup migrated to oxfmt -
Husky pre-commit hook working -
CI pipeline updated -
Documentation updated -
Codebase formatted
🏁 Conclusion
This MR establishes a modern, fast, and enforced code quality system using oxlint, oxfmt, and Husky, ensuring consistent and maintainable code across the VISWAM.AI project.