salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Aura Components Markup Linter errors on an attribute with value "{# ... }"
Summary
This code
Steps To Reproduce:
- Create an Aura component
- Add this markup
<div style="{# 'background-image:url(' + v.url+ ')'}">...</div>
- Save the code, Linter complains
Expected result
- Linter should not complain
Actual result
Linter is complaining
Additional information
These are the errors I get back
VS Code Version: Version 1.28.2 (1.28.2) SFDX CLI Version: sfdx-cli/6.38.0-0d66175ccf (darwin-x64) node-v8.9.4 OS and version: Mac OSX High Sierra v. 10.13.6 (17G65)
This is a known issue in the Aura LSP. It is being worked now. I don't have an exact ETA, but it should be sometime in the next few months.
Thanks @ntotten. Is there something that I can do to disable the error messages? Something like this:
// tslint:disable-next-line:no-console
@eltoroit The only thing that you can do is change the language type to either text or XML. The bad thing is that you will disable all the other HTML features.
@ntotten that could be a good solution, thanks. Changing to XML could be a good idea since the Lightning Aura Components are XML files with some HTML inside. What would I lose if I treat this file as XML?
The big thing you lose is that you don't get code completion on standard HTML components (i.e. <div>
, etc.)
Thanks
@ntotten, Thank you for linking my issue back to an existing issue. Any updates on the ETA?
The same errors (as mentioned in the issue additional info) still persist in Salesforce extension pack version 46.13.0 (dated September 5, 2019) Does anyone has any further updates on ETA ?
This is a limitation of the HTML language in VS Code. It is related to https://github.com/microsoft/vscode/issues/67871
This issue has been linked to a new work item: W-7432033