@lifeomic/eslint-plugin-i18next

2.0.1 • Public • Published

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(".

Readme

Keywords

none

Package Sidebar

Install

npm i @lifeomic/eslint-plugin-i18next

Weekly Downloads

26

Version

2.0.1

License

MIT

Unpacked Size

8.3 kB

Total Files

6

Last publish

Collaborators

  • lifeomicdev
  • npm-lifeomicdev-github