eslint-plugin-agama-i18n

0.1.0 • Public • Published

The ESLint Plugin

This directory contains a simple ESLint plugin which checks that only string literals are passed to the translation functions.

It is closely tied to the Agama project and probably does not make much sense for other projects.

Disabling the Check

In some rare cases using a variable instead of a string literal is correct. In that case disable the check locally:

const SIZES = [ N_("small"), N_("medium"), N_("large") ];

// returns one of the sizes above
const sz = getSize();

// eslint-disable-next-line agama-i18n/string-literals
return <span>{_(sz)}</span>;

Links

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-agama-i18n

Weekly Downloads

8

Version

0.1.0

License

MIT

Unpacked Size

6.35 kB

Total Files

7

Last publish

Collaborators

  • lslezak