Chore: Update `no-untranslated-strings` to check tooltip and template literals (#98281)

pull/98830/head
Tom Ratcliffe 11 months ago committed by GitHub
parent 6568f3669d
commit 1ba9a27f70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 756
      .betterer.results
  2. 5
      packages/grafana-eslint-rules/rules/no-untranslated-strings.cjs

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@ const createRule = ESLintUtils.RuleCreator(
(name) => `https://github.com/grafana/grafana/blob/main/packages/grafana-eslint-rules/README.md#${name}`
);
const propsToCheck = ['label', 'description', 'placeholder', 'aria-label', 'title', 'text'];
const propsToCheck = ['label', 'description', 'placeholder', 'aria-label', 'title', 'text', 'tooltip'];
const noUntranslatedStrings = createRule({
create(context) {
@ -17,7 +17,8 @@ const noUntranslatedStrings = createRule({
const isUntranslatedProp =
(node.value.type === 'Literal' && node.value.value !== '') ||
(node.value.type === 'JSXExpressionContainer' && node.value.expression.type === 'Literal');
(node.value.type === 'JSXExpressionContainer' &&
(node.value.expression.type === 'Literal' || node.value.expression.type === 'TemplateLiteral'));
if (isUntranslatedProp) {
return context.report({

Loading…
Cancel
Save