Skip to content

Commit

Permalink
docs(no-unlocalized-strings): more examples for valid cases (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
timofei-iatsenko authored Oct 11, 2024
1 parent 1ecc912 commit f99a709
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/rules/no-unlocalized-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ Examples of correct code for the `{ "ignoreFunction": ["showIntercomMessage"] }`
```js
/*eslint lingui/no-unlocalized-strings: ["error", { "ignoreFunction": ["showIntercomMessage"] }]*/
const bar = showIntercomMessage('Please, write me')

/*eslint lingui/no-unlocalized-strings: ["error", { "ignoreFunction": ["cva"] }]*/
const labelVariants = cva('text-form-input-content-helper', {
variants: {
size: {
sm: 'text-sm leading-5',
md: 'text-base leading-6',
},
},
})
```

### ignoreAttribute
Expand All @@ -52,11 +62,11 @@ By default, the following attributes are ignored: `className`, `styleName`, `typ

The `ignoreProperty` option specifies property names not to check.

Examples of correct code for the `{ "ignoreProperty": ["text"] }` option:
Examples of correct code for the `{ "ignoreProperty": ["myProperty"] }` option:

```jsx
/*eslint lingui/no-unlocalized-strings: ["error", { "ignoreProperty": ["text"] }]*/
const test = { text: 'This is ignored' }
const test = { myProperty: 'This is ignored' }
object.MyProperty = 'This is ignored'
```

By default, the following properties are ignored: `className`, `styleName`, `type`, `id`, `width`, `height`
By default, the following properties are ignored: `className`, `styleName`, `type`, `id`, `width`, `height`, `displayName`

0 comments on commit f99a709

Please sign in to comment.