Skip to content

VSCode extension not running per project/library in NX-workspace #1183

@work933k

Description

@work933k

Describe the bug
I tried this VSCode extension in a NX-monorepository which is a integrated-workspace. This means that not all projects/libraries have a package.json file, but rely on the package.json in the root.
Per project/library i've set-up a specific betterer configuration, but the vscode extension does not take this structure into account.

To Reproduce
If possible please share a repo with the issue, or another repository which demonstrates the issue.
If possible please include the .betterer.ts file, and the .betterer.results file if applicable.
At a minimum please share the command you are using to run Betterer.

Expected behavior
I expected that upon saving this VSCode extension would start at the directory of the saved file and then traverse upwards until it finds a .betterer.ts file.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: [e.g. Windows, MacOS]
  • Betterer Version [e.g. 4.*]
  • Node Version [e.g. 14.*]

Additional context
I see this in the log output:

[Info  - 2:21:51 PM] Server: file:///root/OurNx/libs/myproduct/profile/src/lib/pages/profile-children-page/profile-children-page.component.ts saved, validating:
[Info  - 2:21:51 PM] Server: Adding "file:///root/OurNx/libs/myproduct/profile/src/lib/pages/profile-children-page/profile-children-page.component.ts" to validation queue at 2023-12-07T13:21:51.037Z
[Info  - 2:21:51 PM] Server: Processing queue at 2023-12-07T13:21:51.037Z
[Info  - 2:21:51 PM] Server: Validating document "file:///root/OurNx/libs/myproduct/profile/src/lib/pages/profile-children-page/profile-children-page.component.ts".
[Info  - 2:21:51 PM] Validator: Folders: 1, Documents: 1
[Info  - 2:21:51 PM] Validator: About to run Betterer.
[Info  - 2:21:51 PM] Validator: Setting CWD to "/root/OurNx".
[Info  - 2:21:51 PM] Validator: Getting Betterer for "/root/OurNx".
[Info  - 2:21:51 PM] Validator: Getting Betterer config.
[Info  - 2:21:51 PM] {"cache":true,"cachePath":"/root/OurNx/.betterer.cache","configPaths":["/root/OurNx/.betterer.ts"],"cwd":"/root/OurNx","filters":[".*"],"resultsPath":"/root/OurNx/.betterer.results","silent":true}
[Info  - 2:21:51 PM] Validator: Running Betterer in "/root/OurNx".
[Info  - 2:21:51 PM] Validator: Running Betterer on "["/root/OurNx/libs/myproduct/profile/src/lib/pages/profile-children-page/profile-children-page.component.ts"]."
[Error - 2:21:51 PM] Validator: Error: could not find config file at "/root/OurNx/.betterer.ts". 😔
[Info  - 2:21:51 PM] Validator: Restoring CWD to "/mnt/c/Users/me/AppData/Local/Programs/Microsoft VS Code".

I would expect that the /root/OurNx/libs/myproduct/profile/.betterer.ts would be used for validation.

Installed VSCode extension: v5.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionIssues with the VSCode Extension

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions