2.0.1 • Published 2 years ago

@lifeomic/eslint-plugin-i18next v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

This repository contains an ESLint plugin for validating usage of i18next.

Installation

yarn add -D @lifeomic/eslint-plugin-i18next

Usage

// .eslintrc.js
module.exports = {
  plugins: ['@lifeomic/i18next'],
  rules: {
    '@lifeomic/i18next/default-value': [
      'error',
      {
        /* optional options object */
      },
    ],
  },
};

Rule Options

default-value

  • translateFunctionNames: an array of translation function names to validate. Default is ['t']
  • allowKeyOnly: whether to allow e.g. t('just-the-key'). Default is false.
  • allowNestingInterpolation: Whether to allow e.g. { defaultValue: 'some string $t(interpolated)' }. Default is false.
  • nestingPrefix: Used when allowNestingInterpolation is false to identify interpolated variables. Default is "$t(".
2.0.1

2 years ago

2.0.0

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago