Documentation
¶
Overview ¶
Package linter provides the core HTML linting orchestration.
Index ¶
- type Config
- type FrameworkConfig
- type Linter
- func (l *Linter) LintContent(filename string, content []byte) ([]rules.Result, error)
- func (l *Linter) LintDir(dir string) ([]rules.Result, error)
- func (l *Linter) LintFile(path string) ([]rules.Result, error)
- func (l *Linter) LintFiles(paths []string) ([]rules.Result, error)
- func (l *Linter) Run(paths []string) (int, error)
- func (l *Linter) SetReporter(r Reporter)
- type Reporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// EnabledRules lists rules to enable (empty means all)
EnabledRules []string
// DisabledRules lists rules to disable
DisabledRules []string
// RuleSeverity overrides severity for specific rules
RuleSeverity map[string]rules.Severity
// MinSeverity filters results to this severity or higher
MinSeverity rules.Severity
// IgnorePatterns are glob patterns for files to skip
IgnorePatterns []string
// ConfigPath is the path to the loaded config file (for debugging)
ConfigPath string
// Frameworks configures framework-specific attribute handling.
Frameworks FrameworkConfig
}
Config holds linter configuration options.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a configuration with all rules enabled.
func (*Config) ErrorsOnly ¶
ErrorsOnly configures the linter to only report errors.
func (*Config) IsRuleEnabled ¶
IsRuleEnabled checks if a rule should be run.
func (*Config) WarningsAndErrors ¶
WarningsAndErrors configures the linter to report warnings and errors.
type FrameworkConfig ¶ added in v0.5.0
type FrameworkConfig struct {
// HTMX enables htmx attribute validation.
HTMX bool
// HTMXVersion specifies which htmx version to validate against ("2" or "4").
// Defaults to "2" when HTMX is enabled.
HTMXVersion string
}
FrameworkConfig configures framework-specific attribute handling.
type Linter ¶
type Linter struct {
// contains filtered or unexported fields
}
Linter coordinates HTML template accessibility checking.
func (*Linter) LintContent ¶
LintContent checks HTML content and returns any violations.
func (*Linter) SetReporter ¶
SetReporter sets the output reporter.
Click to show internal directories.
Click to hide internal directories.