Documentation
¶
Overview ¶
cspell:ignore mdash
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JsxNoLiteralsRule = rule.Rule{ Name: "react/jsx-no-literals", Run: func(ctx rule.RuleContext, options any) rule.RuleListeners { cfg := parseConfig(options) var renamedImports map[string]string if cfg.hasElementOverrides() { renamedImports = collectRenamedImports(ctx.SourceFile) } else { renamedImports = map[string]string{} } return rule.RuleListeners{ ast.KindStringLiteral: func(node *ast.Node) { handleStringLiteral(ctx, node, &cfg, renamedImports) }, ast.KindJsxText: func(node *ast.Node) { handleJsxText(ctx, node, &cfg, renamedImports) }, ast.KindNoSubstitutionTemplateLiteral: func(node *ast.Node) { handleTemplate(ctx, node, &cfg, renamedImports) }, ast.KindTemplateExpression: func(node *ast.Node) { handleTemplate(ctx, node, &cfg, renamedImports) }, ast.KindJsxAttribute: func(node *ast.Node) { handleJsxAttribute(ctx, node, &cfg, renamedImports) }, } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.