Skip to content

Commit e9f0415

Browse files
committed
feat: init commit
0 parents  commit e9f0415

File tree

5 files changed

+1020
-0
lines changed

5 files changed

+1020
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# eslint-config-vue
2+
3+
🔧 一个 Vue 的 ESLint 配置,使用 Prettier 格式化代码。
4+
5+
## 使用
6+
7+
1.安装依赖
8+
9+
```sh
10+
pnpm add -D eslint @longwoo/eslint-config-typescript-prettier
11+
12+
# or
13+
yarn add -D eslint @longwoo/eslint-config-typescript-prettier
14+
15+
# or
16+
npm install --save-dev @longwoo/eslint-config-typescript-prettier
17+
```
18+
19+
2.配置 ESLint
20+
21+
```json
22+
{
23+
"extends": "@longwoo/eslint-config-typescript-prettier"
24+
}
25+
```
26+
27+
3.打开 `package.json` 文件,在 `scripts` 配置中添加 `eslint` 命令,运行 ESLint 校验代码。
28+
29+
```json
30+
{
31+
"scripts": {
32+
"eslint": "eslint --ext .js,.ts,.tsx src"
33+
}
34+
}
35+
```

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
root: true,
4+
env: {
5+
'vue/setup-compiler-macros': true
6+
},
7+
extends: [
8+
'plugin:vue/vue3-essential',
9+
'eslint:recommended',
10+
'@vue/eslint-config-typescript/recommended',
11+
'@vue/prettier'
12+
]
13+
};

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@longwoo/eslint-config-vue",
3+
"version": "1.0.0",
4+
"description": "Vue eslint 配置",
5+
"main": "index.js",
6+
"keywords": [
7+
"eslint",
8+
"eslint-config",
9+
"eslint-config-vue"
10+
],
11+
"author": "long.woo",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@vue/eslint-config-prettier": "^7.0.0",
15+
"@vue/eslint-config-typescript": "^10.0.0",
16+
"eslint-plugin-vue": "^8.2.0"
17+
},
18+
"devDependencies": {
19+
"eslint": "^8.17.0",
20+
"prettier": "^2.6.2",
21+
"typescript": "^4.6.4"
22+
},
23+
"peerDependencies": {
24+
"eslint": "^8.17.0",
25+
"prettier": "^2.6.2",
26+
"typescript": "^4.6.4"
27+
}
28+
}

0 commit comments

Comments
 (0)