Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoTemplateCurlyInString = rule.Rule{ Name: "no-template-curly-in-string", Run: func(ctx rule.RuleContext, options any) rule.RuleListeners { regex := regexp.MustCompile(`\$\{[^}]+\}`) return rule.RuleListeners{ ast.KindStringLiteral: func(node *ast.Node) { expr := node.AsStringLiteral() if regex.MatchString(expr.Text) { ctx.ReportNode(node, rule.RuleMessage{ Id: "unexpectedTemplateExpression", Description: "Template literal placeholder syntax in regular strings is not allowed.", }) } }, } }, }
https://eslint.org/docs/latest/rules/no-template-curly-in-string
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.