Skip to content

Commit bf6664d

Browse files
author
Anthony Lasserre
committed
Own requested changes
1 parent 8dc9fbf commit bf6664d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/eslint-plugin-react-native/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
plugins: ['@getluko/react-native'],
2828
rules: {
2929
'@getluko/react-native/lower-dash-case-test-id': 1,
30-
'@getluko/react-native/i18n-avoid-global-imports: 1,
30+
'@getluko/react-native/i18n-avoid-global-imports: 2,
3131
}
3232
```
3333

packages/eslint-plugin-react-native/src/rules/i18n-avoid-global-imports/__mocks__/valid.statements.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ const MyComponent = () => {
1818
`,
1919
`
2020
import i18n from '@locales/i18n';
21-
const getTabData = () => [
21+
const getData = () => [
2222
{
23-
title: stringCapitalize(i18n.t('home.electricity.hours')),
24-
scene: <DebugChart temporality="daily" />,
23+
title: i18n.t('home.electricity.hours'),
2524
},
2625
]
2726
`,

packages/eslint-plugin-react-native/src/rules/i18n-avoid-global-imports/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const hasTranslatePropertyIdentifier = (
1919
return (
2020
"parent" in node &&
2121
"property" in node.parent &&
22+
"name" in node.parent.property &&
2223
node.parent.property.name === "t"
2324
);
2425
};

0 commit comments

Comments
 (0)