-
Notifications
You must be signed in to change notification settings - Fork 404
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
jsconfig.json generates incorrectly and disallows correction #5520
Comments
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. |
Link to Bug W-15374337 |
likewise |
@djeune can you please describe the user impact on development due to this behavior? |
The configuration file is necessary for type acquisition when attempting to use VSCode's built-in javascript/typescript features. When I discovered the problem, I was attempting to get type information working from one LWC component to another. For example, if I had an LWC component that imported shared code from a different component, I wanted vscode to support type information from that shared code. Code sharing process described here. I reported the erroneous file generation because is generating invalid configuration files. However, the best case would be if the standard configuration supported the use case linked above. |
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:
sf project generate
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.
The text was updated successfully, but these errors were encountered: