navigation

DiscourageStringInterpolationWithStringFormat (FL0093)

Introduced in 0.26.12

Cause

String interpolation is done with String.Format.

Rationale

The more idiomatic way to do string interpolation in F# is with the sprintf function, which is statically type-checked: the F# compiler will complain when too few arguments are supplied or its types don't match (unlike with String.Format), therefore allowing you to fail-fast (bring potential errors to compile-time instead of letting them be experienced by the user at run-time).

How To Fix

Use sprintf instead of String.Format.

Rule Settings

{
    "discourageStringInterpolationWithStringFormat": {
        "enabled": false
    }
}