Détail du package

eslint-plugin-i18n-prefix

nirtamir2287MIT0.0.6

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

eslint, eslintplugin, eslint-plugin

readme

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