lint

package
v0.3.44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package lint implements configurable, source-oriented TypeRB style checks. Language correctness remains owned by the parser, resolver, and checker.

Index

Constants

View Source
const (
	RecommendedPreset               = "recommended"
	NoRulesPreset                   = "none"
	PreferConditionalTransferRuleID = "trb/prefer-conditional-transfer"
)

Variables

This section is empty.

Functions

func Analyze

func Analyze(program *ast.Program, source []byte, path string, options ResolvedOptions) []diagnostic.Diagnostic

func ApplyFixes

func ApplyFixes(source []byte, path string, items []diagnostic.Diagnostic) ([]byte, int, error)

func SortDiagnostics

func SortDiagnostics(items []diagnostic.Diagnostic)

Types

type Level

type Level string
const (
	Off     Level = "off"
	Warning Level = "warning"
	Error   Level = "error"
)

type Metadata

type Metadata struct {
	ID            string
	Summary       string
	DefaultLevel  Level
	Recommended   bool
	Since         string
	Fixable       bool
	Documentation string
}

func Registry

func Registry() []Metadata

type Options

type Options struct {
	Preset string
	Rules  map[string]string
}

type ResolvedOptions

type ResolvedOptions struct {
	// contains filtered or unexported fields
}

func Resolve

func Resolve(options Options) (ResolvedOptions, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL