Documentation
¶
Index ¶
- type Rule
- func (r *Rule) ApplySettings(settings map[string]any) error
- func (r *Rule) Category() string
- func (r *Rule) Check(f *lint.File) []lint.Diagnostic
- func (r *Rule) CheckNode(n ast.Node, entering bool, f *lint.File) []lint.Diagnostic
- func (r *Rule) DefaultSettings() map[string]any
- func (r *Rule) EnabledByDefault() bool
- func (r *Rule) ID() string
- func (r *Rule) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
Rule implements MDS041, flagging raw HTML in Markdown documents.
The lookup form of Allow is memoised on the per-Check *lint.File via File.Memo (see cachedAllowSet) rather than on the rule instance. Rule instances are shared across concurrent LSP calls (cmd/mdsmith/lsp.go reuses rule.All(), and ConfigureRule does not clone when cfg.Settings is nil), so any mutable state on the rule itself would race; *lint.File is created fresh per Check and File.Memo is sync.Map + sync.Once protected.
func (*Rule) ApplySettings ¶
ApplySettings implements rule.Configurable.
func (*Rule) Check ¶
func (r *Rule) Check(f *lint.File) []lint.Diagnostic
Check implements rule.Rule. The per-HTML-node logic is pure and stateless, so it is expressed as CheckNode and the engine can fold this rule into one shared AST walk; a direct call still works via rule.WalkNodes.
func (*Rule) DefaultSettings ¶
DefaultSettings implements rule.Configurable.
func (*Rule) EnabledByDefault ¶
EnabledByDefault implements rule.Defaultable. MDS041 is opt-in.