FSharpLintAnalyzerShim 0.3.0-alpha.6
dotnet add package FSharpLintAnalyzerShim --version 0.3.0-alpha.6
NuGet\Install-Package FSharpLintAnalyzerShim -Version 0.3.0-alpha.6
<PackageReference Include="FSharpLintAnalyzerShim" Version="0.3.0-alpha.6" />
<PackageVersion Include="FSharpLintAnalyzerShim" Version="0.3.0-alpha.6" />
<PackageReference Include="FSharpLintAnalyzerShim" />
paket add FSharpLintAnalyzerShim --version 0.3.0-alpha.6
#r "nuget: FSharpLintAnalyzerShim, 0.3.0-alpha.6"
#:package FSharpLintAnalyzerShim@0.3.0-alpha.6
#addin nuget:?package=FSharpLintAnalyzerShim&version=0.3.0-alpha.6&prerelease
#tool nuget:?package=FSharpLintAnalyzerShim&version=0.3.0-alpha.6&prerelease
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
- Discovers
fsharplint.jsonby walking up from each file's directory (cached per directory). - Converts the Analyzer SDK's
CliContextinto FSharpLint'sParsedFileInformation. - Calls
FSharpLint.Application.Lint.lintParsedFile. - Maps each
LintWarningto an Analyzer SDKMessage.
Quick start
Prerequisites
- .NET 10 SDK
fsharp-analyzersCLI:dotnet tool install -g fsharp-analyzers- Paket:
dotnet tool install -g paket
Heads-up: the published
fsharp-analyzers0.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 | Versions 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. |
-
net10.0
- FSharp.Analyzers.SDK (>= 0.37.2)
- FSharp.Compiler.Service (>= 43.12.204)
- FSharp.Core (>= 10.1.301)
- System.Security.Cryptography.Xml (>= 10.0.9)
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 |