mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Update no-untranslated-strings
to check tooltip and template literals (#98281)
This commit is contained in:
parent
6568f3669d
commit
1ba9a27f70
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}`
|
(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({
|
||||||
|
Loading…
Reference in New Issue
Block a user