FSharpLintAnalyzerShim 0.2.0-alpha.1

This is a prerelease version of FSharpLintAnalyzerShim.
dotnet add package FSharpLintAnalyzerShim --version 0.2.0-alpha.1
                    
NuGet\Install-Package FSharpLintAnalyzerShim -Version 0.2.0-alpha.1
                    
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.2.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FSharpLintAnalyzerShim" Version="0.2.0-alpha.1" />
                    
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.2.0-alpha.1
                    
#r "nuget: FSharpLintAnalyzerShim, 0.2.0-alpha.1"
                    
#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.2.0-alpha.1
                    
#: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.2.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FSharpLintAnalyzerShim&version=0.2.0-alpha.1&prerelease
                    
Install as a Cake Tool

FSharpLintAnalyzerShim

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

This lets you run FSharpLint alongside custom project analyzers in one fsharp-analyzers invocation, eliminating duplicate project loading.

How it works

The shim:

  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

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

Setup

Prerequisites

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

Build

paket install
dotnet build -c Release

Run

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

You can combine with other analyzer paths:

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 no config file is found, FSharpLint's built-in default configuration is used.

See the FSharpLint documentation for config format.

Diagnostics

All diagnostics use the standard FSharpLint rule codes (FL0001 through FL0097). Severity is always Warning. Suggested fixes from FSharpLint are passed through as Analyzer SDK Fix records.

If FSharpLint encounters an internal error (which it normally swallows silently), the shim surfaces it as an FL0000 Info diagnostic.

Rule suppression

FSharpLint's built-in suppression mechanisms 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

Supported directives:

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. See the FSharpLint documentation for the full config format.

Dependencies

FSharpLint.Core is pulled from michaelglass/FSharpLint (perf/two-phase-lint-api branch) via Paket git dependency. This branch merges Numpsy's fcs10 branch, which updated FSharpLint to FSharp.Compiler.Service 43.x -- huge thanks to Numpsy (Richard Webb) for that work. The perf/two-phase-lint-api branch pins FCS to 43.10.101 for compatibility with the fsharp-analyzers CLI v0.36.0 and adds a two-phase lint API for analyzer integration.

Development

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

Tests

  • ConfigDiscoveryTests -- config file discovery, directory walking, caching
  • WarningMappingTests -- LintWarning-to-Message field mapping, fix mapping, severity
  • IntegrationTests -- end-to-end: lint source with violations, verify mapped output
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.2.0-alpha.1 33 4/7/2026