palerdot/react-d3-speedometer

no-template-curly-in-string for currentValueText

Closed this issue · 6 comments

When I set currentValueText with the value (e.g. "${value} some text"), I get a compile warning:

Line 275: Unexpected template string expression no-template-curly-in-string

The reason is because ${value} is what you use for es6 template strings.

Is there some work around for this - or should the syntax be changed, so as not to collide with this syntax / warning?

@matttk Thanks for raising this. For now, is it possible to temporarily disable this in your code using eslint-disable-line no-template-curly-in-string or eslint-disable-next-line no-template-curly-in-string?. Changing existing syntax will be kind of breaking change. Ideally there can be some kind of another configuration like currentTextPlaceholderStyle: $(value), so that people can just use whatever style that suits them. I will try to add this config in next release, so that current default behaviour is not affected.

@matttk This configuration is added in 0.5.0 version (to be released shortly). You can see live example - https://palerdot.in/react-d3-speedometer/?path=/story/react-d3-speedometer--custom-current-value-placeholder-style-for-eg-value

v0.5.5 released which addresses an issue because of babel 7 runtime - https://www.npmjs.com/package/react-d3-speedometer/v/0.5.0. Please reopen if you face any issues.

Update: Please use latest 0.5.5 version which addresses babel7 runtime errors. A live example of correct package can be seen here - https://codesandbox.io/s/53wj7x516x

Please reopen if you face any issues with 0.5.x releases. As mentioned, please update to latest 0.5.5 version and see if this issue is addressed.

Sorry, I finally got around to checking into this and everything is working great in the latest version. Thanks! 👍