Skip to content

nirtamir2/eslint-plugin-i18n-prefix

Repository files navigation

eslint-plugin-i18n-prefix

ESLint rule that helps verify that i18n translation key starts with matching component name

npm version

Example

Installation

pnpm add -D eslint eslint-plugin-eslint-plugin-i18n-prefix

Usage

Add to .eslintrc

{
  "extends": ["plugin:eslint-plugin-i18n-prefix/recommended"]
}

Rules

✅ Set in the recommended configuration

🔧 Automatically fixable by the --fix CLI option.

Name Description 💼 🔧
i18n-prefix Ensure i18n translation key starts with matching component name. 🔧

i18n-prefix

Ensure i18n translation key starts with matching component name

{
	"i18n-prefix/i18n-prefix": [
		"error",
		{
            "translationFunctionName": "t",
            "delimiter": ".",
            "ignorePrefixes": []
		}
	]
}

Notes

This can be used together with https://github.com/natura-cosmeticos/eslint-plugin-i18n-checker

About

ESLint rule to check if i18n translation key starts with matching component name

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published