From dfc4fe5b6edb7353239c7a1ac56177162c57349d Mon Sep 17 00:00:00 2001 From: VICSOLWANG <413834325@qq.com> Date: Fri, 24 Dec 2021 00:14:56 +0800 Subject: [PATCH] feat: update package and README.md --- README.md | 24 +++++++++++++----------- package.json | 7 +++++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d94571c..7676899 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,24 @@ # eslint-config-wzx-react -[![NPM version](https://img.shields.io/npm/v/eslint-config-wzx-react)](https://www.npmjs.com/package/eslint-config-wzx-react) -[![node](https://img.shields.io/node/v/eslint-config-wzx-react)](https://nodejs.org) -[![Build Status](https://travis-ci.com/VicSolWang/eslint-config-wzx-react.svg?branch=master)](https://travis-ci.com/VicSolWang/eslint-config-wzx-react) -[![codecov](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react/branch/master/graph/badge.svg)](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react) -[![NPM downloads](https://img.shields.io/npm/dt/eslint-config-wzx-react)](https://www.npmjs.com/package/eslint-config-wzx-react) +[![NPM version](https://img.shields.io/npm/v/eslint-config-wzx-react?logo=npm&style=flat-square)](https://www.npmjs.com/package/eslint-config-wzx-react) +[![node](https://img.shields.io/node/v/eslint-config-wzx-react?logo=nodedotjs&style=flat-square)](https://nodejs.org) +[![Code Style](https://img.shields.io/badge/code%20style-prettier-ff69b4?logo=prettier&style=flat-square)](https://prettier.io) +[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/VicSolWang/eslint-config-wzx-react/test-release-ci/master?logo=github&style=flat-square)](https://github.com/VicSolWang/eslint-config-wzx-react/actions/workflows/test-release.yml) +[![release](https://img.shields.io/badge/release-semantic--release-e10079?logo=semantic-release&style=flat-square)](https://github.com/semantic-release/semantic-release) +[![codecov](https://img.shields.io/codecov/c/gh/VicSolWang/eslint-config-wzx-react/master?label=codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/VicSolWang/eslint-config-wzx-react) +[![NPM downloads](https://img.shields.io/npm/dt/eslint-config-wzx-react?style=flat-square)](https://www.npmjs.com/package/eslint-config-wzx-react) -The custom react eslint rules based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). (Support Typescript Eslint) +> The custom react eslint rules based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). (Support Typescript Eslint) -# Installation +## :cd: Installation npm install --save-dev eslint-config-wzx-react -Note: Typescript eslint needs to install [typescript](https://www.npmjs.com/package/typescript), [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser), [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin). +:bulb: Typescript eslint needs to install [typescript](https://www.npmjs.com/package/typescript), [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser), [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin). npm install --save-dev typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin -# Usage +## :rocket: Usage Add eslint-config-wzx-react to the "extends" in your `.eslintrc.* file`. @@ -24,8 +26,8 @@ Add eslint-config-wzx-react to the "extends" in your `.eslintrc.* file`. "extends": "wzx-react" } -Note: Typescript eslint needs `tsconfig.json` in your project root directory. +:bulb: Typescript eslint needs `tsconfig.json` in your project root directory. -# License +## :lock: License [MIT](LICENSE). diff --git a/package.json b/package.json index e5b34c1..0d603c8 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "cover:report": "nyc report --reporter=text-lcov > coverage.lcov", "husky:pre-commit": "husky add .husky/pre-commit \"npx lint-staged\"", "husky:commit-msg": "husky add .husky/commit-msg \"npx --no-install commitlint --edit $1\"", - "prepare": "husky install && npm run husky:pre-commit && npm run husky:commit-msg" + "husky:init": "husky install && npm run husky:pre-commit && npm run husky:commit-msg", + "prepare": "is-ci || npm run husky:init" }, "repository": { "type": "git", @@ -43,7 +44,7 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.3", "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.27.1", + "eslint-plugin-react": "^7.28.0", "eslint-plugin-react-hooks": "^4.3.0" }, "peerDependencies": { @@ -57,7 +58,9 @@ "@typescript-eslint/eslint-plugin": "^5.8.0", "@typescript-eslint/parser": "^5.8.0", "ava": "^3.15.0", + "fs-extra": "^10.0.0", "husky": "^7.0.4", + "is-ci": "^3.0.1", "lint-staged": "^12.1.3", "nyc": "^15.1.0", "prettier": "^2.5.1",