rome / tools

Unified developer tools for JavaScript, TypeScript, and the web
https://docs.rome.tools/
MIT License
23.75k stars 664 forks source link

📎 `rome init` should read `.prettierrc` and convert options #3587

Open sebmck opened 1 year ago

sebmck commented 1 year ago

Description

This would drastically help with migration. Especially for users who have opted out of Prettier defaults. Notably we could automatically set indentStyle etc.

joealden commented 1 year ago

Would it also be possible for it to read .prettierignore, or are the ignore formats not compatible?

MichaReiser commented 1 year ago

Would it also be possible for it to read .prettierignore, or are the ignore formats not compatible?

That should be possible once our ignore setting supports negative patterns.

ematipico commented 1 year ago

@sebmck rome init is not the correct command to do these kind of things. If you remember, we decided to remove such "import configuration from other tools" from init and use a new command called auto-config.

The old rome init was more powerful than the one we have at the moment, and it used to create various files (rome.json with some additional goodies, .editorconfig), but it wasn't meant to import configuration from other tools.

auto-config was meant to "import" configuration from other tools: prettier, eslint, typescript, etc.

MichaReiser commented 1 year ago

@sebmck rome init is not the correct command to do these kind of things. If you remember, we decided to remove such "import configuration from other tools" from init and use a new command called auto-config.

Let's restate the issue that there should be a way to automatically migrate the configuration. It would be interesting to understand the reasoning why that "decision" was made. Having it in rome init has the advantage that users only need to run a single command rather than 2.

ematipico commented 1 year ago

Here the first issue: https://github.com/rome/tools/issues/1112#issue-680542868

EDIT:

The old rome init command was meant to be run inside a project where rome wasn't installed. The init command was able to install it and updating the package.json. The command now doesn't do that because there's so awareness of a "project", but we will have that. So it's best to keep the two commands separated, unless we decide now to review the semantics of the command init

github-actions[bot] commented 1 year ago

👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella

Conaclos commented 1 year ago

This could be great if Rome supports .editorconfig.