eslint-plugin-i18n-prefix
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

Package Sidebar

Install

npm i eslint-plugin-i18n-prefix

Weekly Downloads

291

Version

0.0.6

License

MIT

Unpacked Size

22.4 kB

Total Files

19

Last publish

Collaborators

  • nirtamir2