@sanity/eslint-config-i18n
An ESLint configuration to help with localizing Sanity Studios.
This package utilizes @rushstack/eslint-patch to include plugins as dependencies. This making installation easier and allows us to manage those dependencies for you.
Depends on:
Installation
Install
yarn add eslint @sanity/eslint-config-i18n --dev
or
npm install eslint @sanity/eslint-config-i18n --save-dev
Update the configuration
Update your .eslintrc
to include "@sanity/eslint-config-i18n"
{
"extends": [
"@sanity/eslint-config-studio",
"@sanity/eslint-config-i18n"
]
}
Optionally: If you wish to configure @sanity/eslint-plugin-i18n
:
{
"extends": ["@sanity/eslint-config-studio", "@sanity/eslint-config-i18n"],
"rules": {
"@sanity/i18n/no-attribute-string-literals": [
"error",
{
"ignores": {},
"only": {},
"mode": "extends"
}
],
"@sanity/i18n/no-attribute-string-literals": [
"error",
{
"ignores": {},
"only": {},
"mode": "extends"
}
]
},
"overrides": [
{
"files": [
"**/*/test/**/*",
"**/*/__tests__/**/*",
"**/*.test.{js,ts,tsx}"
],
"rules": {
"i18next/no-literal-string": "off",
"@sanity/i18n/no-attribute-string-literals": "off",
"@sanity/i18n/no-attribute-template-literals": "off"
}
}
]
}
Release new version
Run "CI & Release" workflow.
Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.