Skip to content

feat: migrate to oxlint & oxfmt and enforce code quality via Husky

Praveena Veeranki requested to merge chore/setup-oxlint-format into UI

📋 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

👉 Eliminates tool conflicts and simplifies setup

🔹 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

👉 Ensures all developers use the same commands

🔹 4. Pre-commit Hooks (Husky)

  • Initialized Husky
  • Added .husky/pre-commit

Behavior:

Before every commit:

npm run lint
npm run format

👉 Prevents:

  • 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

  • Verified npm run lint works correctly
  • Verified npm run format formats 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 install

    after 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.json
  • oxlint.json
  • .husky/pre-commit
  • .gitlab-ci.yml
  • PROJECT_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.

Merge request reports

Loading