@fullstory/eslint-plugin-annotate-react

中文文档
0.0.10发布于 2023/08/01MIT零依赖近 30 天下载 2371

用于注释反应组件的ESLint插件.

中文使用文档
文档目录6 节
  1. 安装
  2. 使用量
  3. 维护此插件
  4. 支持的规则
  5. @ fulstory/ 注释- react/ data- 组件
  6. 释放

@ fulstory/eslint-plugin-annotate- react 页面存档备份,存于互联网档案馆

为 React 组件添加“ 数据属性” 的 ESLint 插件 。 此插件的目的是自动制作 Css 选择器. 以下是一个例子:

const MyComponent = () => (
  <div />
);

此插件将自动修正并添加 data-component 向 div 显示 :

const MyComponent = () => (
  <div data-component="MyComponent" />
);

此插件的用意是不被太评价 。 一般来说,这种方法是在有明显的方法时向开发者建议添加"数据组件",但在有疑问的情况下,插件会倾向于安静. 点击以了解更多 涉及的案件。 。 。 .

说明: 此插件无法保证 data-component 如果顶级元素是另一个回放组件,道克会实际到达DOM节点. 为了有效工作,确保你身体正常 使用 JSX 扩展语法转发道具。 。 。 .

安装

你首先需要安装 ESLint 语录数字 :

npm i eslint --save-dev

下一个,安装 @fullstory/eslint-plugin-annotate-react数字 :

npm install @fullstory/eslint-plugin-annotate-react --save-dev

使用量

添加 @fullstory/eslint-plugin-annotate-react 到您的插件区 .eslintrc 配置文件 。 你可以省略这个 eslint-plugin- 前缀 :

{
  "plugins": ["@fullstory/annotate-react"]
}

然后在规则章节下配置您想要使用的规则 .

{
  "rules": {
    "@fullstory/annotate-react/data-component": "error"
  }
}

维护此插件

测试可以使用

npm run test

支持的规则

@ fulstory/ 注释- react/ data- 组件

.

释放

运行此命令以缓冲版本, 按下标记, 并在 GitHub 上创建发布 :

npx np <patch | minor | major> --no-publish --no-tests

版本与发布记录

@fullstory/eslint-plugin-annotate-react 共发布 11 个版本,首次发布于 2022/07/27;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.10latest2023/08/013 年前
0.0.112023/08/013 年前
0.0.92023/07/193 年前
0.0.82023/07/193 年前
0.0.72022/12/103 年前
0.0.62022/09/204 年前

关于 @fullstory/eslint-plugin-annotate-react 的常见问题

@fullstory/eslint-plugin-annotate-react 是什么?

用于注释反应组件的ESLint插件.

如何安装 @fullstory/eslint-plugin-annotate-react?

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

@fullstory/eslint-plugin-annotate-react 支持 TypeScript 吗?

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

@fullstory/eslint-plugin-annotate-react 可以商用吗?

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

@fullstory/eslint-plugin-annotate-react 的下载量有多少?

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

@fullstory/eslint-plugin-annotate-react 还在维护吗?

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