navigation

SynchronousFunctionNames (FL0095)

Introduced in 0.26.12

Cause

Function that is not async (does not return Async or Task) has Async prefix or suffix.

Rationale

By convention, Async prefix or suffix in function name means that the function is asyncronous.

Prefix is used for functions that return Async type, e.g.:

let AsyncFoo(): Async<int> =
    async { return 1 }

Suffix is used for functions that return System.Threading.Task type, e.g.:

open System.Threading

let FooAsync(): Task<int> =
    task { return 1 }

How To Fix

Remove Async prefix or suffix from function name.

Rule Settings

{
    "synchronousFunctionNames": {
        "enabled": true
    }
}