Skip to content

Commit 247296d

Browse files
committed
InterpolatedStringWithNoSubstitution: updated docs
To reflect changes to the rule.
1 parent 4d05c9f commit 247296d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/content/how-tos/rules/FL0087.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ hide_menu: true
1212

1313
Interpolated string (with `$` prefix, such as `$"foo"`) is used without embedded F# expression (e.g. `$"{foo}"` where foo is some value).
1414

15+
Or string formatting function such as `sprintf` or `failwithf` is used without interpolation.
16+
1517
## Rationale
1618

1719
Usage of interpolated string without embedded F# expression(s) may indicate that the expression was intended to be used but wasn't used by mistake.
1820

19-
For regular strings, use regular string syntax.
20-
2121
## How To Fix
2222

2323
Use regular string or embed F# expression using curly braces (`{}`).
2424

25+
Use `failwith` instead of `failwithf` if no formatting/interpolation is needed.
26+
2527
## Rule Settings
2628

2729
{

src/FSharpLint.Core/Text.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,6 @@
382382
<value>Prefer using the 'as' pattern to match a constant and bind it to a variable.</value>
383383
</data>
384384
<data name="InterpolatedStringWithNoSubstitution" xml:space="preserve">
385-
<value>Use interpolated string (with $ prefix) only when embedding F# expression in that string using {}.</value>
385+
<value>Do not use interpolated string syntax (with $ prefix) or formatting functions (sprintf, failwithf) when not really performing any interpolation.</value>
386386
</data>
387387
</root>

0 commit comments

Comments
 (0)