Init
lintsync init [tool] --preset=<name> — installs dependencies, generates config file(s) from a preset, records them in the manifest, and wires up lint/lint:fix/format npm scripts.
lintsync init [tool] [options]lintsync init --preset=vue-app # eslint + prettier + stylelint, one shot
lintsync init eslint --preset=npm-lib # just eslint, e.g. because prettier is already set up
lintsync init --preset=vue-app --force # overwrite an existing config instead of skipping it
lintsync init # no --preset in a real terminal: prompts interactively- Without
[tool], every tool the preset defines is initialized in one run.npm-libnever offers Stylelint, since that preset doesn't define it at all. - If a tool's config file already exists (under any of its conventional names), that tool is skipped with a warning rather than aborting the whole command. Pass
--forceto overwrite it instead. - Dependencies are installed via whatever package manager the project already uses (detected from lockfiles), as ordinary
devDependencies— LintSync never editspackage.json's dependency lists by hand. --preset <name>resolves against both the 4 built-in presets and any presets you've saved locally (see Presets) — same name, same behavior either way.
Options
--preset <name>
Which preset to apply. Omit it in a real terminal to prompt interactively instead — see The interactive flow below. In CI (no TTY) or with --json, omitting it is an error.
--force
Overwrite an existing config file for a tool instead of skipping it with a warning.
--cwd <path>
Project directory. Default: the current directory.
--json
Machine-readable output.
--quiet
Suppress output on success.
--verbose
No additional effect beyond the default view today — reserved for consistency with sync/status.
The interactive flow
Run with no --preset in a real terminal, init prompts with three options:
- Use a built-in or saved preset — pick from
vue-app/react-app/npm-lib/baseplus anything you've saved locally. - Pick tools individually (generic defaults) — checkboxes for ESLint/Prettier/Stylelint, using the
basepreset's values as-is. - Build and save a new custom preset — see Building a custom preset below.
If a config already exists for a tool being initialized, the interactive flow asks to overwrite it (y/n) rather than silently skipping — --force still skips that question and overwrites directly.
Building a custom preset
The third option is an interactive constructor:
- ESLint, if included, reuses the
basepreset's block verbatim — there's no per-rule editor for it. - Prettier — pick which of Prettier's own options to set, from its live option list (sourced from Prettier's own
getSupportInfo()API, so it always matches whatever Prettier version LintSync bundles). Each one gets the right kind of prompt: a checkbox for a boolean, a list of the real valid values for a choice option, free text for a number or string. - Stylelint — pick as many base configs to extend as apply (e.g. SCSS and Vue together:
stylelint-config-standard-scss,stylelint-config-standard-less,stylelint-config-recommended-vue, alongside plainstylelint-config-standard), then set values for any of roughly 80 rules pulled from Stylelint's own-recommended/-standardconfigs — booleans as checkboxes, choice-type rules from their real, source-verified value lists, patterns/numbers as free text. Stylelint has no live-schema API like Prettier's, so this list is hand-curated from those two official config packages rather than guessed. Turning onscss/at-rule-no-unknownautomatically addsstylelint-scssto the preset's dependencies. Answering "off" on a boolean rule writes an explicitnull— Stylelint's own way to disable a rule a base config already turned on — rather than just omitting the key.
You're then asked to name the preset. The name is rejected if it's empty, or if it collides with a built-in preset name or one you've already saved. Once named, it's saved to the local presets store and appears in the preset list from then on, in every project on the machine — see Presets.
Cancelling (Ctrl+C/Esc) at any step of the interactive flow exits with code 1 and no further output.