|
|
|
@ -5,7 +5,7 @@ const createRule = ESLintUtils.RuleCreator( |
|
|
|
(name) => `https://github.com/grafana/grafana/blob/main/packages/grafana-eslint-rules/README.md#${name}` |
|
|
|
(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({ |
|
|
|
const noUntranslatedStrings = createRule({ |
|
|
|
create(context) { |
|
|
|
create(context) { |
|
|
|
@ -17,7 +17,8 @@ const noUntranslatedStrings = createRule({ |
|
|
|
|
|
|
|
|
|
|
|
const isUntranslatedProp = |
|
|
|
const isUntranslatedProp = |
|
|
|
(node.value.type === 'Literal' && node.value.value !== '') || |
|
|
|
(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) { |
|
|
|
if (isUntranslatedProp) { |
|
|
|
return context.report({ |
|
|
|
return context.report({ |
|
|
|
|