Back to Twenty

Oxlint Migration TODO

packages/twenty-oxlint-rules/OXLINT_MIGRATION_TODO.md

2.2.03.9 KB
Original Source

Oxlint Migration TODO

This file tracks what was lost or temporarily disabled during the ESLint to Oxlint migration, and what needs to be re-activated or addressed.

Temporarily Disabled Rules

twenty-server

RuleReasonViolationsAuto-fixable
typescript/consistent-type-imports3814 pre-existing violations. Cannot be auto-fixed because NestJS relies on emitDecoratorMetadata for DI — the auto-fixer converts constructor parameter imports to import type, which erases them at runtime and breaks dependency injection.3814No (unsafe auto-fix)
twenty/max-consts-per-file94 pre-existing violations across 24 constant files with >1 export94No

Re-activated Rules

twenty-front

RuleViolations FixedMethod
twenty/sort-css-properties-alphabetically578Auto-fix via npx nx lint twenty-front --configuration=fix

Dropped Plugins (No Oxlint Equivalent)

These plugins were in use but have no oxlint equivalent. Consider whether alternative tooling is needed.

PluginWhere UsedWhat It DidReplacement / Status
eslint-plugin-project-structureFrontendEnforced folder naming and structure conventions for src/modules/ (kebab-case dirs, allowed subdirs like hooks/utils/components, file naming for hooks/utils). Config still in folderStructure.json.Re-implemented as twenty/folder-structure custom oxlint rule. Enabled as "warn" — 403 pre-existing violations (160 non-kebab-case names, 215 depth > 4, 28 naming).
lingui/*Frontend, emailsi18n extraction and consistency rulesNo equivalent
@stylistic/*ServerFormatting rules (indentation, spacing)Use Prettier instead
import/order, simple-import-sort/importsServerImport sorting and orderingNo equivalent
prefer-arrow/prefer-arrow-functionsFrontendEnforced arrow functions over function declarationsNo equivalent
eslint-plugin-mdxDocsMDX file lintingNot supported by oxlint
@next/eslint-plugin-nextWebsiteNext.js-specific rules (no ``, link handling, etc.)Not supported by oxlint
eslint-plugin-unused-importsFrontendRemoved unused imports on savePartially covered by no-unused-vars
eslint-plugin-storybookFrontendStorybook best practices (story structure, naming)No equivalent
eslint-plugin-jsx-a11yFrontendAccessibility rules (alt text, aria, roles, etc.)Partial equivalent in Oxlint (jsx-a11y plugin), but coverage is limited.
eslint-plugin-react-refreshFrontendReact Refresh boundary validation (HMR)No equivalent

IDE Integration

The oxc.oxc-vscode extension provides inline diagnostics for built-in oxlint rules but does not yet support jsPlugins (custom twenty/* rules). Custom rule violations are only caught by nx lint and CI.

Remaining Re-activation Plan

  1. Consistent type imports (twenty-server): Cannot safely auto-fix due to NestJS emitDecoratorMetadata. Options:
    • Manually add import type only where safe (not for DI constructor params)
    • Enable TypeScript's verbatimModuleSyntax (major migration)
    • Keep disabled until oxlint supports decorator-aware type import analysis
  2. Max consts per file (twenty-server): Manually split 24 constant files to have at most 1 exported const each, then re-enable the rule.
  3. Folder structure enforcement (twenty-front): Re-implemented as twenty/folder-structure custom oxlint rule (enabled as "warn"). 403 pre-existing violations to address:
    • 160 non-kebab-case module folder names (e.g. graphWidgetBarChartgraph-widget-bar-chart)
    • 215 modules nested deeper than 4 levels
    • 28 util/hook file naming violations (.util.ts suffixes, kebab-case filenames, PascalCase)
    • Promote to "error" once violations are resolved