Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsconfig.json generates incorrectly and disallows correction #5520

Open
djeune opened this issue Mar 26, 2024 · 3 comments
Open

jsconfig.json generates incorrectly and disallows correction #5520

djeune opened this issue Mar 26, 2024 · 3 comments
Labels

Comments

@djeune
Copy link

djeune commented Mar 26, 2024

Summary

When the Salesforce Extensions for VSCode activate, they generate a jsconfig.json file within the lwc directory to support intellisense in Lightning Web Components.

When the file is generated, it includes a key "paths" as a top level property of the configuration object. This is the incorrect place for the key, as it belongs within the compilerOptions object.

See documentation here for more information. Specifically, the "jsConfig options" header describes the correct configuration.

To make the issue worse, this improper configuration is re-applied after removal any time the Salesforce Extensions reload.

Steps To Reproduce:

  1. Generate a new project with the Salesforce CLI command sf project generate
  2. Observe the generated jsconfig.json file within the lwc directory and its improper structure.
  3. Move the key to the compilerOptions object and save the file.
  4. Reload the window from the command palette to force the Salesforce Extensions to reload.
  5. Observe that the erroneous key has been re-added to the configuration.

Expected result

The jsconfig.json file should generate with a valid configuration file. Failing that, it should respect the user's attempts to fix it.

Actual result

The jsconfig.json file generates with an invalid "paths" key and re-adds this key when it is removed.

Additional information

Salesforce Extension Version in VS Code: 60.5.1

SFDX CLI Version: 2.33.3

OS and version: MacOS Sonoma 14.3.1

VS Code version: 1.87.2

Additional note on preferred fix: I would prefer to be able to modify files after generation without worrying about the extensions overriding my changes. I have also run into this problem with .forceignore, which doesn't allow me to the remove .eslint.json entry even though I am using the flat config eslint.config.js file located at the root of the project.

@CristiCanizales
Copy link
Contributor

CristiCanizales commented Mar 30, 2024

Hi @djeune, sorry for the delay. Thank you for bringing this to out attention! I was able to replicate this bug and we'll be adding it to our backlog.

@CristiCanizales
Copy link
Contributor

Link to Bug W-15374337

@nwcm
Copy link

nwcm commented May 27, 2024

likewise baseUrl is required in complierOptions when using * path mappings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants