FSharpLintAnalyzerShim 0.3.0-alpha.6

This is a prerelease version of FSharpLintAnalyzerShim.
dotnet add package FSharpLintAnalyzerShim --version 0.3.0-alpha.6
                    
NuGet\Install-Package FSharpLintAnalyzerShim -Version 0.3.0-alpha.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FSharpLintAnalyzerShim" Version="0.3.0-alpha.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FSharpLintAnalyzerShim" Version="0.3.0-alpha.6" />
                    
Directory.Packages.props
<PackageReference Include="FSharpLintAnalyzerShim" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FSharpLintAnalyzerShim --version 0.3.0-alpha.6
                    
#r "nuget: FSharpLintAnalyzerShim, 0.3.0-alpha.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FSharpLintAnalyzerShim@0.3.0-alpha.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FSharpLintAnalyzerShim&version=0.3.0-alpha.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FSharpLintAnalyzerShim&version=0.3.0-alpha.6&prerelease
                    
Install as a Cake Tool

FSharpLintAnalyzerShim

A thin adapter that aims to expose all 97 FSharpLint rules as a single FSharp.Analyzers.SDK [<CliAnalyzer>].

Status: early alpha, and substantially AI-written. Behavior and APIs shift between versions, so your mileage may vary. Issues and PRs are very welcome.

The problem

If you run both FSharpLint and your own F# analyzers, you load every project twice — once for each tool — and pay for type-checking the whole solution twice. The goal here is to make FSharpLint be an analyzer, so it can run alongside your custom analyzers in one fsharp-analyzers invocation with a single project load.

All rule logic lives in FSharpLint.Core; this project contains no rules of its own.

How it works

  1. Discovers fsharplint.json by walking up from each file's directory (cached per directory).
  2. Converts the Analyzer SDK's CliContext into FSharpLint's ParsedFileInformation.
  3. Calls FSharpLint.Application.Lint.lintParsedFile.
  4. Maps each LintWarning to an Analyzer SDK Message.

Quick start

Prerequisites

  • .NET 10 SDK
  • fsharp-analyzers CLI: dotnet tool install -g fsharp-analyzers
  • Paket: dotnet tool install -g paket

Heads-up: the published fsharp-analyzers 0.36.0 ships an FCS version this shim can't bind against, so you currently need an analyzer host on the FCS 43.12 line to run it. See Host compatibility.

Build

paket install
dotnet build -c Release

Run

fsharp-analyzers \
  --project path/to/YourProject.fsproj \
  --analyzers-path path/to/FSharpLintAnalyzerShim/bin/Release/net10.0/

Pass --analyzers-path more than once to combine with your own analyzers:

fsharp-analyzers \
  --project path/to/YourProject.fsproj \
  --analyzers-path path/to/FSharpLintAnalyzerShim/bin/Release/net10.0/ \
  --analyzers-path path/to/YourOtherAnalyzers/bin/Release/net10.0/

Configuration

Place a fsharplint.json anywhere in the file's directory hierarchy. The shim walks up from each source file to find the nearest config, just like FSharpLint itself. If none is found, FSharpLint's built-in default configuration is used.

See the FSharpLint documentation for the config format.

Rule suppression

FSharpLint's built-in suppression is meant to work through the shim with no extra configuration.

Inline comments — disable rules per-line or per-section:

// fsharplint:disable-next-line RecordFieldNames
type Foo = { bar: int }

// fsharplint:disable MaxLinesInFunction
// ... long function ...
// fsharplint:enable MaxLinesInFunction
Directive Effect
// fsharplint:disable RuleName Disable for rest of file
// fsharplint:enable RuleName Re-enable
// fsharplint:disable-line RuleName Disable for current line
// fsharplint:disable-next-line RuleName Disable for next line

Omit the rule name to apply to all rules.

fsharplint.json — disable rules globally by setting "enabled": false on any rule.

Diagnostics

FSharpLint rule diagnostics use the standard FSharpLint rule codes (FL0001 through FL0097), always at Warning severity. Suggested fixes are passed through as Analyzer SDK Fix records.

The shim also emits its own FL0000 diagnostics (all Warning, since CI hosts suppress Info/Hint):

Type Meaning
FSharpLint.HostIncompatible The host loaded an FCS minor version the shim can't bind against. See Host compatibility.
FSharpLint.ConfigError A discovered fsharplint.json couldn't be parsed; names the file and error, then lints with the default config.
FSharpLint.InternalError FSharpLint hit an internal error it would otherwise swallow; the shim surfaces it.
FSharpLint.Error FSharpLint reported a lint failure for the file (its description is passed through).

Development

mise run check    # build + test + lint
mise run build    # build only
mise run test     # tests only

Dependencies

FSharpLint.Core is pulled from michaelglass/FSharpLint (perf/two-phase-lint-api branch) via a Paket git dependency. That branch merges Numpsy's fcs10 branch, which updated FSharpLint to FSharp.Compiler.Service 43.x — huge thanks to Numpsy (Richard Webb) for that work. It tracks the FCS 43.12 line and adds a two-phase lint API for analyzer integration. The shim pins FCS to 43.12.204; see Host compatibility for what that means for the host you run it under.

More

  • Host compatibility — FCS binary coupling and the mismatch symptom.
  • Rule coverage — which rules the test suite exercises, and the test layout.
  • Benchmarks — shim vs. the FSharpLint CLI on single projects and nested solutions.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-alpha.6 55 6/25/2026
0.3.0-alpha.5 61 6/24/2026
0.3.0-alpha.4 55 6/12/2026
0.3.0-alpha.3 47 5/28/2026
0.3.0-alpha.2 59 5/28/2026
0.3.0-alpha.1 160 4/17/2026
0.2.0-alpha.2 72 4/17/2026
0.2.0-alpha.1 69 4/7/2026