Skip to content

Commit 8924ccf

Browse files
committed
chore: update i18n rule for attrs translate
1 parent b6f74d0 commit 8924ccf

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

configs/eslint-config.mjs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,46 @@ export default tseslint.config(
7474
'arrow-parens': 0,
7575
camelcase: ['error', { properties: 'never' }],
7676
'consistent-return': 'off',
77-
'i18next/no-literal-string': 'warn',
77+
'i18next/no-literal-string': [
78+
'warn',
79+
{
80+
callees: {
81+
exclude: [
82+
'__',
83+
'i18n(ext)?',
84+
't',
85+
'require',
86+
'addEventListener',
87+
'removeEventListener',
88+
'postMessage',
89+
'getElementById',
90+
'dispatch',
91+
'commit',
92+
'includes',
93+
'indexOf',
94+
'endsWith',
95+
'startsWith'
96+
]
97+
},
98+
'jsx-attributes': {
99+
include: [
100+
'title',
101+
'aria-label',
102+
'okText',
103+
'cancelText',
104+
'placeholder',
105+
'description',
106+
'label',
107+
'helperText',
108+
'invalidMessage'
109+
],
110+
'object-properties': {
111+
include: ['label', 'description', 'helperText', 'invalidMessage', 'title']
112+
}
113+
},
114+
mode: 'jsx-only'
115+
}
116+
],
78117
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
79118
'import/extensions': 'off',
80119
'import/first': 'error',

0 commit comments

Comments
 (0)