eslint-config-ufe

1.0.4 • Public • Published

eslint-config-ufe

javascript 代码规范, 规范继承自airbnb在此基础上进行调整.目前支持es6+, 如果有需要可以支持es5及以下

javascript代码规范文档: 英文 中文

react代码规范文档: 英文 中文

已覆盖的规范请查看rules文件夹

使用

  1. 安装npm包

    npm install --save-dev eslint eslint-config-ufe eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y 
  2. 创建.eslintrc 复制内容

    {
      "extends": "ufe",
    }
     
    // 未使用到 react
    {
      "extends": "ufe/base",
    }

规范调整

规范调整前, 请先与相关同学进行讨论, 达成统一结论后进行调整, 调整完成后publish到npm上并通知相关同学进行更新.

rules文件夹下分为base和两个react, 如果需要修改react/、jsx-a11y/开头的规则, 分别在这两个文件中进行配置, 其余的配置在base中. 增加配置时请增加说明和规范的地址, 例如:

// 文件名必须为jsx  -> 这里是说明
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md -> 这里写规则说明地址
'react/jsx-filename-extension': 0,

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-ufe

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • ufe-tj