Skip to content

sanity-io/eslint-config-i18n

Repository files navigation

@sanity/eslint-config-i18n

An ESLint configuration to help with localizing Sanity Studios.

This ESLint config provides rules to enforce specific code standards in internationalization practices, particularly focusing on strings literals in JSX. It aims to improve code quality and maintainability in projects with internationalization concerns.

Depends on:

Installation

Install

pnpm add eslint @sanity/eslint-config-i18n --save-dev

or

npm install eslint @sanity/eslint-config-i18n --save-dev

Update the configuration

Update your eslint.config.mjs to include "@sanity/eslint-config-i18n"

 import studio from '@sanity/eslint-config-studio'
+import i18n from '@sanity/eslint-config-i18n'

export default [
   ...studio,
+  ...i18n,
]

Version compatibility

This package is designed to work with ESLint >= 9, which supports/uses the new "flat configuration" format.

If you are using ESLint <= 8, you should install and use @sanity/eslint-config-i18n@1.

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.

About

An ESLint configuration to help with localizing Sanity Studios

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 5