Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoUselessEmptyExportRule = rule.CreateRule(rule.Rule{ Name: "no-useless-empty-export", Run: func(ctx rule.RuleContext, options any) rule.RuleListeners { if isDefinitionFile(ctx.SourceFile.FileName()) { return rule.RuleListeners{} } // First pass: collect all statements to check for exports var emptyExports []*ast.Node hasOtherExports := false for _, statement := range ctx.SourceFile.Statements.Nodes { if isEmptyExport(statement) { emptyExports = append(emptyExports, statement) } else if isExportOrImportStatement(statement) { hasOtherExports = true } } if hasOtherExports { for _, emptyExport := range emptyExports { ctx.ReportNodeWithFixes(emptyExport, rule.RuleMessage{ Id: "uselessExport", Description: "Empty export does nothing and can be removed.", }, rule.RuleFixRemove(ctx.SourceFile, emptyExport)) } } return rule.RuleListeners{} }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.