salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Aura Components Markup Linter errors on an attribute with value "{# ... }"

Open eltoroit opened this issue 6 years ago • 10 comments

Summary

This code

fails linter, but is valid Aura Components markup.

Steps To Reproduce:

  1. Create an Aura component
  2. Add this markup <div style="{# 'background-image:url(' + v.url+ ')'}">...</div>
  3. Save the code, Linter complains

Expected result

  1. Linter should not complain

Actual result

Linter is complaining

Additional information

These are the errors I get back screen shot 2018-11-01 at 8 16 07 pm

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)

eltoroit avatar Nov 02 '18 00:11 eltoroit

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.

ntotten avatar Nov 05 '18 14:11 ntotten

Thanks @ntotten. Is there something that I can do to disable the error messages? Something like this:

// tslint:disable-next-line:no-console

eltoroit avatar Nov 15 '18 18:11 eltoroit

@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 avatar Nov 15 '18 18:11 ntotten

@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?

eltoroit avatar Nov 15 '18 19:11 eltoroit

The big thing you lose is that you don't get code completion on standard HTML components (i.e. <div>, etc.)

ntotten avatar Nov 15 '18 19:11 ntotten

Thanks

eltoroit avatar Nov 15 '18 23:11 eltoroit

@ntotten, Thank you for linking my issue back to an existing issue. Any updates on the ETA?

combizs avatar Mar 07 '19 00:03 combizs

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 ?

ghost avatar Sep 11 '19 18:09 ghost

This is a limitation of the HTML language in VS Code. It is related to https://github.com/microsoft/vscode/issues/67871

ntotten avatar Sep 18 '19 21:09 ntotten

This issue has been linked to a new work item: W-7432033

git2gus[bot] avatar Apr 09 '20 20:04 git2gus[bot]