Hako.Analyzers
1.0.13
dotnet add package Hako.Analyzers --version 1.0.13
NuGet\Install-Package Hako.Analyzers -Version 1.0.13
<PackageReference Include="Hako.Analyzers" Version="1.0.13"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Hako.Analyzers" Version="1.0.13" />
<PackageReference Include="Hako.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Hako.Analyzers --version 1.0.13
#r "nuget: Hako.Analyzers, 1.0.13"
#:package Hako.Analyzers@1.0.13
#addin nuget:?package=Hako.Analyzers&version=1.0.13
#tool nuget:?package=Hako.Analyzers&version=1.0.13
Hako.Analyzers
Roslyn analyzers and code fixes for the Hako JavaScript engine.
Installation
dotnet add package Hako.Analyzers
The analyzer is automatically integrated into your IDE and build process.
Analyzers
HAKO100: Missing Module Export
Detects when module exports are set but not declared in the module definition.
Problem:
var module = runtime.CreateCModule("myModule", init =>
{
init.SetExport("foo", 42);
init.SetFunction("greet", greeter);
init.SetClass("Calculator", calculatorClass);
});
// Warning: Exports 'foo', 'greet', and 'Calculator' are not declared
Fixed:
var module = runtime.CreateCModule("myModule", init =>
{
init.SetExport("foo", 42);
init.SetFunction("greet", greeter);
init.SetClass("Calculator", calculatorClass);
})
.AddExport("foo")
.AddExport("greet")
.AddExport("Calculator");
Code Fix:
The analyzer provides an automatic code fix that adds missing AddExport calls. Use "Fix All" to batch fix multiple missing exports in a single module.
Why This Matters
Module exports must be explicitly declared using AddExport or AddExports. Forgetting to declare an export means the value won't be accessible from JavaScript imports, causing runtime errors that are hard to debug.
Documentation
See the main Hako documentation for complete API reference.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.3.0)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.