Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 505 Bytes

t-call-in-function.md

File metadata and controls

20 lines (14 loc) · 505 Bytes

t-call-in-function

Tip

This rule is included into the lingui/recommended config

Check that t calls are inside function. They should not be at the module level otherwise they will not react to language switching.

import { t } from '@lingui/macro'

// nope ⛔️
const msg = t`Hello world!`

// ok ✅
function getGreeting() {
  return t`Hello world!`
}

Check the Lingui Docs for more info.