@elastic/eslint-plugin-react-intl

中文文档
1.2.0发布于 2018/06/14MITCommonJS近 30 天下载 1.5万

react-intl specific linting rules for ESLint

原始使用文档

eslint-plugin-react-intl

Note: This is a fork from http://npmjs.org/package/eslint-plugin-react-intl.

react-intl (2.0) specific linting rules for ESLint

Installation

Install ESLint either locally or globally.

$ npm install eslint

If you installed ESLint globally, you have to install React-intl plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-react-intl

Configuration

Add plugins section and specify ESLint-plugin-React as a plugin.

{
  "plugins": [
    "@elastic/eslint-plugin-react-intl"
  ]
}

If it is not already the case you must also configure ESLint to support JSX.

With ESLint 1.x.x:

{
  "ecmaFeatures": {
    "jsx": true
  }
}

With ESLint 2.x.x:

{
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    }
  }
}

List of supported rules

  • string-is-marked-for-translation: Catch strings that aren't marked for translation, e.g. contained in a component from react-intl 2.0.
  • is-valid-icu-message-syntax: Catch defaultMessage attributes that aren't valid ICU message syntax
  • no-inline-translations-with-formatmessage: Forbid calls to formatMessage() from using literal translations, because there are not picked up by babel-plugin-react-intl.

Thanks

License

ESLint-plugin-React-intl is licensed under the MIT License.

版本与发布记录

@elastic/eslint-plugin-react-intl 共发布 1 个版本,首次发布于 2018/06/14;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.2.0latest2018/06/148 年前

关于 @elastic/eslint-plugin-react-intl 的常见问题

@elastic/eslint-plugin-react-intl 是什么?

react-intl specific linting rules for ESLint

如何安装 @elastic/eslint-plugin-react-intl?

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

@elastic/eslint-plugin-react-intl 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/elastic__eslint-plugin-react-intl 是否存在。

@elastic/eslint-plugin-react-intl 支持 ESM 还是 CommonJS?

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

@elastic/eslint-plugin-react-intl 可以商用吗?

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

@elastic/eslint-plugin-react-intl 的下载量有多少?

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

@elastic/eslint-plugin-react-intl 还在维护吗?

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