square / eslint-plugin-square

An ESLint plugin containing custom JavaScript, Ember, React, TypeScript rules and configurations tailored to Square's needs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rule no-translation-key-interpolation requires serviceName

edcheung1 opened this issue · comments

The rule no-translation-key-interpolation checks for the following syntax to flag interpolated strings as translation keys:

<serviceName>.t(`some interpolated string`)

We currently import our translation method directly (i.e. import { t } from 'i18n') as opposed to importing the library (i.e. import i18n from 'i18n'). The rule is not able to catch translation key interpolations in this format:

t(`some interpolated string`)

Possible fix: