tools icon indicating copy to clipboard operation
tools copied to clipboard

🐛 VSCode Rome project config in subdirectory of monorepo

Open eliliam opened this issue 3 years ago • 2 comments

Environment information

VSCode Insiders connected to a remote VM via Remote-SSH extension.

What happened?

I have a monorepo node project that looks something like this:

.
|--back-end // This is a ES6 node program that will use Rome
|   |--rome.json
|   |--package.json // This is where Rome is installed
|   |--src
|       |--index.js
|       |--otherFiles.js
|--front-end // This submodule is a React app and will not be using Rome(yet)
|    |--package.json
|    |--.eslintrc.js
|    |--src
|        |--index.js
|        |--App.jsx
|--package.json // Holds some very minimal configs for things like pnpm and pre-commit hooks

In VSCode I always open the root of the project, but noticed that when I do that, Rome doesn't respect the rome.json that lives in the back-end folder. To get it to respect that file, I have to open the back end folder directly or add the folder to the a workspace. Is it possible for Rome to use the rome.json file that's in a subdirectory instead of the root of the project? This is a major dealbreaker for shifting my company over to Rome from ESLint.

Expected result

The VSCode Rome extension formatter/linter should use the closest rome.json config file to the file being formatted/linted, as other packages like ESLint and Prettier do.

Code of Conduct

  • [x] I agree to follow Rome's Code of Conduct

eliliam avatar Sep 28 '22 23:09 eliliam

We are aware that at the moment the configuration discovery doesn't work like other tools, and we plan to address the issue in the next release.

There's something important to note though, the extension is meant to work as "Language Server" - the same way the "TypeScript language server" works - which means that even though the discovery of the configuration file is enhanced, the extension will keep analyzing all the workspace.

We are discussing if that's the correct way or not, and your use case is surely an interesting one that we need to consider.

ematipico avatar Sep 29 '22 14:09 ematipico

This issue is stale because it has been open 14 days with no activity.

github-actions[bot] avatar Oct 14 '22 12:10 github-actions[bot]

Closing! This has been implemented

ematipico avatar May 08 '23 13:05 ematipico