zw-standard

1.1.1 • Public • Published

zw-standard

简介

这是一个用于zw项目的前端标准配置与脚本的集合库,包含了ESlint规则配置、Prettier规则配置、git commit校验脚本。

引用Eslint配置需在 .eslintrc.js 添加如下代码。

module.exports = {
  extends: [require.resolve('zw-standard/eslint-config/vue')],
};

引用Prettier配置需在 .prettierrc.js 添加如下代码。

const prettierConfig = require('zw-standard/prettier');
module.exports = prettierConfig;

引用git提交(文件检查eslint与描述检查)需要安装需安装yorkie并在package.json对应中添加执行指令如

  "gitHooks": {
    "pre-commit": "lint-staged",
    "commit-msg": "node node_modules/zw-standard/git-hooks/commit-msg-verify.js"
  }
  "lint-staged": {
    "*.{js,jsx,vue,ts,tsx}": [
      "eslint --config=.eslintrc.js"
    ]
  }

Package Sidebar

Install

npm i zw-standard

Weekly Downloads

7

Version

1.1.1

License

MIT

Unpacked Size

32.5 kB

Total Files

8

Last publish

Collaborators

  • cpyzw