@geoblink/eslint-plugin-i18next

中文文档
6.1.3发布于 2026/09/09ISCTypeScriptCommonJS近 30 天下载 5455

ESLint plugin for i18n — MyTraffic fork of eslint-plugin-i18next, adding the no-missing-plural-count and no-empty-translation-string rules

原始使用文档
文档目录4 节
  1. Installation
  2. Usage
  3. Rule no-literal-string
  4. Breaking change

@geoblink/eslint-plugin-i18next

ESLint plugin for i18n. MyTraffic's fork of edvardchen/eslint-plugin-i18next, published under the @geoblink scope because the two rules below don't exist upstream:

  • no-missing-plural-count
  • no-empty-translation-string

The version tracks the upstream release the fork is based on. no-literal-string and everything else below is upstream's, unchanged.

For old versions below v6, plz refer this document

Installation

npm install @geoblink/eslint-plugin-i18next --save-dev

Usage

For ESLint 9 flat configuration,

// eslint.config.mjs
import i18next from '@geoblink/eslint-plugin-i18next';

export default [
  // your other configs
  i18next.configs['flat/recommended'],
];

For ESLint 8 and below,

// .eslintrc
{
  "extends": ["plugin:@geoblink/i18next/recommended"]
}

Rule no-literal-string

This rule aims to avoid developers to display literal string directly to users without translating them.

Note: Disable auto-fix because key in the call i18next.t(key) usually was not the same as the literal

Example of incorrect code:

/*eslint i18next/no-literal-string: "error"*/
<div>hello world</div>

Example of correct code:

/*eslint i18next/no-literal-string: "error"*/
<div>{i18next.t('HELLO_KEY')}</div>

More options can be found here

Breaking change

By default, it will only validate the plain text in JSX markup instead of all literal strings in previous versions. You can change it easily

版本与发布记录

@geoblink/eslint-plugin-i18next 共发布 1 个版本,首次发布于 2026/09/09;过去 12 个月发布了 1 个版本。

版本发布日期距今
6.1.3latest2026/09/092 个月前

关于 @geoblink/eslint-plugin-i18next 的常见问题

@geoblink/eslint-plugin-i18next 是什么?

ESLint plugin for i18n — MyTraffic fork of eslint-plugin-i18next, adding the no-missing-plural-count and no-empty-translation-string rules

如何安装 @geoblink/eslint-plugin-i18next?

在项目目录运行 npm install @geoblink/eslint-plugin-i18next,或使用 pnpm add / yarn add / bun add。

@geoblink/eslint-plugin-i18next 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@geoblink/eslint-plugin-i18next 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@geoblink/eslint-plugin-i18next 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@geoblink/eslint-plugin-i18next 可以商用吗?

@geoblink/eslint-plugin-i18next 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@geoblink/eslint-plugin-i18next 的下载量有多少?

根据 npm 官方下载统计,@geoblink/eslint-plugin-i18next 在 2026/10/16 – 2026/11/14 这 30 天内被下载 5,455 次,日均约 182 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@geoblink/eslint-plugin-i18next 还在维护吗?

最新版本 6.1.3 发布于 2026/09/09(2 个月前);至今共发布 1 个版本,其中过去 12 个月发布了 1 个;首次发布于 2026/09/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。