0.0.24 • Published 2 years ago

@cloudflare/eslint-plugin-i18n v0.0.24

Weekly downloads
55
License
ISC
Repository
-
Last release
2 years ago

eslint-plugin-i18n

A list of recommended rules for how to catch naked strings. A naked string is a string that is not internationalized.

Installation

You'll first need to install ESLint:

$ yarn -D eslint

Next, install eslint-plugin-i18n:

$ yarn add eslint-plugin-i18n

Note: If you installed ESLint globally (using the yarn global flag) then you must also install eslint-plugin-i18n globally.

Usage

Add i18n to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "i18n"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "i18n/rule-name": 2
    }
}

Supported Rules

This plugin will throw errors for:

  • variable declarations of naked string literals ie) const foo = 'test'; <p>{foo}</p>

  • variable declarations of naked template literals ie) const foo2 = `test`; <p>{foo}</p>

  • naked template literals inside of jsx expression containers ie) const bar = <Trans id={`TESTING`} />

  • naked string literals inside of jsx expression containers ie) <div>{'wtf'}</div>

0.0.24

2 years ago

0.0.23

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.16

3 years ago

0.0.15

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago