Skip to content

Generates a .oxlintrc.json from a existing eslint flat config.

License

Notifications You must be signed in to change notification settings

oxc-project/oxlint-migrate

Repository files navigation

@oxlint/migrate

test NPM Version NPM Downloads

Generates a .oxlintrc.json from a existing eslint flat config.

Usage

npx @oxlint/migrate <optional-eslint-flat-config-path>

When no config file provided, the script searches for the default eslint config filenames in the current directory.

Options

Options Description
--merge * merge eslint configuration with an existing .oxlintrc.json configuration
--type-aware Include type aware rules, which are supported with oxlint --type-aware
--with-nursery Include oxlint rules which are currently under development
--js-plugins ** Include ESLint plugins via jsPlugins key.
--output-file <file> The oxlint configuration file where to eslint v9 rules will be written to, default: .oxlintrc.json
--replace-eslint-comments Search in the project files for eslint comments and replaces them with oxlint. Some eslint comments are not supported and will be reported.

* WARNING: When some categories are enabled, this tools will enable more rules with the combination of plugins. Else we need to disable each rule plugin/categories combination, which is not covered by your eslint configuration. This behavior can change in the future.

** WARNING: Tries to guess the plugin name. Should work with most of the plugin names. Not every ESLint API is integrated with oxlint. Tested ESLint Plugins with oxlint can be found in this Oxc Discussion.

User Flow

  • Upgrade oxlint and @oxlint/migrate to the same version.
  • Execute npx @oxlint/migrate
  • (Optional): Disable supported rules via eslint-plugin-oxlint

TypeScript ESLint Configuration Files

For Deno and Bun, TypeScript configuration files, like eslint.config.mts, are natively supported. For Node.js, you must install jiti as a dev dependency.

Contributing

Generate rules

Generates the rules from installed oxlint version

pnpm generate
pnpm format

Unit + Integration Test

pnpm vitest

Manual Testing

pnpm manual-test

About

Generates a .oxlintrc.json from a existing eslint flat config.

Resources

License

Stars

Watchers

Forks

Sponsor this project