Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@lifeomic/eslint-plugin-i18next

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lifeomic/eslint-plugin-i18next

An ESLint plugin for validating i18next usage

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
40
-52.94%
Maintainers
2
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 18 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts