Skip to content

Migrating Legacy Configs ​

lintsync migrate <tool> --to <format> converts a legacy config to a new format or location. It never deletes the source file and never overwrites an existing target — both checked before anything is written.

bash
lintsync migrate <tool> --to <format> [options]
bash
lintsync migrate eslint --to flat      # .eslintrc.* -> eslint.config.mjs
lintsync migrate prettier --to yaml    # .prettierrc.json -> .prettierrc.yaml
lintsync migrate stylelint --to json

Each tool only supports the target format(s) that actually make sense for it:

  • eslint — only --to flat (target: eslint.config.mjs).
  • prettier / stylelint — only --to json, --to yaml, or --to js (not flat — that's an ESLint-only concept).

Requesting an unsupported tool/format combination is a plain error.

Migrating ESLint to flat config ​

lintsync migrate eslint --to flat — only rules is migrated — it's byte-for-byte the same shape in both formats. Anything else found in the legacy file (extends, plugins, env, parserOptions, globals, overrides, ...) is listed as needing manual review instead of being guessed at, since each of those has real semantic differences between legacy and flat config.

Converting Prettier and Stylelint formats ​

lintsync migrate prettier --to <format> / lintsync migrate stylelint --to <format> — format-for-format (json/yaml/js) — these configs are plain data, so every key carries over unchanged.

Legacy file detection ​

Legacy sources are found by conventional filename, checked in this order (first match wins):

ToolFilenames checked, in order
ESLint.eslintrc.json, .eslintrc.yaml, .eslintrc.yml, .eslintrc.js, .eslintrc.cjs
Prettier.prettierrc.json, .prettierrc.yaml, .prettierrc.yml, .prettierrc.js, .prettierrc.cjs, prettier.config.js
Stylelint.stylelintrc.json, .stylelintrc.yaml, .stylelintrc.yml, .stylelintrc.js

A bare .eslintrc/.prettierrc with no extension is not auto-detected — its format is only decidable by sniffing the file's content, which migrate doesn't attempt.

Options ​

--to <format> ​

Required. The target format — flat for ESLint, or json/yaml/js for Prettier/Stylelint.

--cwd <path> ​

Project directory. Default: the current directory.

--json ​

Machine-readable output.

--quiet ​

Suppress output on success.

Example output:

✓ .eslintrc.json → eslint.config.mjs
  migrated: rules
  needs manual review: extends, env