Socket
Book a DemoInstallSign in
Socket

eslint-plugin-electron

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-electron

eslint-plugin-electron

7.0.0
latest
npmnpm
Version published
Weekly downloads
348
-21.27%
Maintainers
1
Weekly downloads
 
Created
Source

开发指南

准备工作

安装node:http://nodejs.cn/ 安装脚手架:npm install -g yo generator-eslint 进入根目录安装依赖:npm install

目录结构

+ docs
  + rules # 规则说明,由yo:rules自动生成
    - 规则1.md
    - 规则2.md
    - ...
+ examples # eslint-plugin-electron 使用的例子
+ lib # 源文件目录
  - const # 常量
  - utils # 公共方法
  + rules # 规则文件,目录结构由yo:rules生成,开发者自己填充内容
    - 规则1.js
    - 规则2.js
    - ...
+ tests # 单测用例,目录结构由yo:rules生成,开发者自己填充内容
  - 规则1.js
  - 规则2.js
  - ...

开发步骤

使用 yo eslint:rule 自动生成规则,生成之后会自动创建三个文件:

// 创建一条名为“no-console”的规则
docs/rules/no-console.md // 规则说明文档
lib/rules/no-console.js // 规则源码
tests/lib/rules/no-console.js // 规则单测用例

如何自动化测试

npm test

todo

  • 参数废弃:
    • 参数限定某几个的情况
  • 属性废弃:
    • 暂不支持 jsx 的解析
      • 无法解析箭头函数

暂时无法写成rule的变更

https://www.electronjs.org/docs/breaking-changes#removed-marked-property-on-getblinkmemoryinfo

https://www.electronjs.org/docs/breaking-changes#behavior-changed-webkitdirectory-attribute-for-input-typefile-now-lists-directory-contents

Keywords

eslint

FAQs

Package last updated on 30 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.