Incorrect Analysis: Analyzer giving incorrect example on Two-Fer exercise

Describe the incorrectness
The analyzer commented on my solution that it could be helpful to use string interpolation. In the example it provides it show this: "Hello there \${firstName}, I will give you \${calculateInventory()} apples.". However, this does not work. The only way I get it to work is by using backticks () instead of single or double quotes. Even when escaping the $, running yarn test` fails.

Which exercise
Two Fer

Source file(s)

two-fer.ts

Expected analysis
I expect the example to use backticks instead of double quotes.

Additional context

Incorrect Analysis: Analyzer giving incorrect example on Two-Fer exercise · Issue #54 · exercism/typescript-analyzer · GitHub

You are right, the only way to do string interpolation as far as I am aware is through using backticks.

1 Like

How where you able to answer so fast? I literally just posted this :rofl:. Too bad I can’t post my original screenshot, apparently the issues on Github are instantly closed and it referred me to here. Here’s a link to the original issue on Github Incorrect Analysis: Analyzer giving incorrect example on Two-Fer exercise · Issue #54 · exercism/typescript-analyzer · GitHub

I was just going to check a thing on the forum and saw this post and it seemed intresting. I am not the maintainer of Javascript nor Typescript. But I have found where that comment comes from:
typescript-analyzer/shared.ts at 4b862f6cd8d0a4de59ebd4278bc14e7ef10c915a · exercism/typescript-analyzer · GitHub.

I think the text that gets shown to the user on the platform is actually here: website-copy/prefer_templated_strings.md at main · exercism/website-copy · GitHub

I don’t really know why the JS/TS analyzer seem to also have all comments inline in the analyzer code, but I’m pretty sure all analyzers pull comments from the website-copy repository in the end :thinking: @SleeplessByte would know more about this.

They only have it inline so we can run the tests of the analyzer without pulling the website copy repo.

For regular usage it works the same as all other analysers!