docs: add README (#66)

This commit is contained in:
云游君 2021-10-31 22:58:00 +08:00 committed by GitHub
parent c4a8f9ef5f
commit 3ac8a75af3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 7 deletions

53
README.md Normal file
View File

@ -0,0 +1,53 @@
# @antfu/eslint-config
[![npm](https://img.shields.io/npm/v/@antfu/eslint-config)](https://npmjs.com/package/@antfu/eslint-config)
## Usage
### Install
```bash
pnpm add -D eslint @antfu/eslint-config
```
### Config `.eslintrc`
```json
{
"extends": [
"@antfu"
]
}
```
### Config `.eslintignore`
```txt
dist
public
```
### Add script for package.json
For example:
```json
{
"scripts": {
"lint": "eslint \"**/*.{vue,ts,js}\""
}
}
```
### Config VSCode auto fix
Create `.vscode/settings.json`
```json
{
"prettier.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
```

View File

@ -16,8 +16,8 @@ importers:
packages/all: packages/all:
specifiers: specifiers:
'@antfu/eslint-config-react': ^0.9.0 '@antfu/eslint-config-react': ^0.10.0
'@antfu/eslint-config-vue': ^0.9.0 '@antfu/eslint-config-vue': ^0.10.0
'@typescript-eslint/eslint-plugin': ^5.0.0 '@typescript-eslint/eslint-plugin': ^5.0.0
'@typescript-eslint/parser': ^5.0.0 '@typescript-eslint/parser': ^5.0.0
eslint: ^8.0.1 eslint: ^8.0.1
@ -84,7 +84,7 @@ importers:
packages/react: packages/react:
specifiers: specifiers:
'@antfu/eslint-config-ts': ^0.9.0 '@antfu/eslint-config-ts': ^0.10.0
eslint: ^8.0.1 eslint: ^8.0.1
eslint-plugin-react: ^7.26.1 eslint-plugin-react: ^7.26.1
react: ^17.0.2 react: ^17.0.2
@ -99,7 +99,7 @@ importers:
packages/typescript: packages/typescript:
specifiers: specifiers:
'@antfu/eslint-config-basic': ^0.9.0 '@antfu/eslint-config-basic': ^0.10.0
'@typescript-eslint/eslint-plugin': ^5.0.0 '@typescript-eslint/eslint-plugin': ^5.0.0
'@typescript-eslint/parser': ^5.0.0 '@typescript-eslint/parser': ^5.0.0
eslint: ^8.0.1 eslint: ^8.0.1
@ -112,7 +112,7 @@ importers:
packages/vue: packages/vue:
specifiers: specifiers:
'@antfu/eslint-config-ts': ^0.9.0 '@antfu/eslint-config-ts': ^0.10.0
eslint: ^8.0.1 eslint: ^8.0.1
eslint-plugin-vue: 7.19.1 eslint-plugin-vue: 7.19.1
dependencies: dependencies:
@ -2230,7 +2230,8 @@ packages:
dev: true dev: true
/encoding/0.1.13: /encoding/0.1.13:
resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} resolution: {integrity: sha1-VldK/deR9UqOmyeFwFgqLSYhD6k=, tarball: encoding/download/encoding-0.1.13.tgz}
requiresBuild: true
dependencies: dependencies:
iconv-lite: 0.6.2 iconv-lite: 0.6.2
dev: true dev: true
@ -5643,9 +5644,10 @@ packages:
dev: true dev: true
/uglify-js/3.10.0: /uglify-js/3.10.0:
resolution: {integrity: sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==} resolution: {integrity: sha1-OXp+bjHOggv9HLVbgE7hQMWHqec=, tarball: uglify-js/download/uglify-js-3.10.0.tgz}
engines: {node: '>=0.8.0'} engines: {node: '>=0.8.0'}
hasBin: true hasBin: true
requiresBuild: true
dev: true dev: true
optional: true optional: true