mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-12 15:20:43 +08:00
✨ 添加 ESLint 工作流以支持Pull Requests中的代码检查,并在 package.json 中添加 lint 脚本
This commit is contained in:
parent
5f719d5e5a
commit
f2fb191b52
31
.github/workflows/eslint.yml
vendored
Normal file
31
.github/workflows/eslint.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: ESLint Lint for Pull Requests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/*.js'
|
||||
- '**/*.ts'
|
||||
- '**/*.vue'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 检出代码
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# 设置 Node.js 环境
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
# 安装依赖
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
# 运行 ESLint
|
||||
- name: Run ESLint
|
||||
run: npm run lint
|
||||
@ -5,7 +5,8 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint ."
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.7",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user