ci: add linter for every PR & commit (#6988)

This commit is contained in:
Sukka 2021-02-23 19:54:48 +08:00 committed by GitHub
parent 3f0f53c48d
commit 3f871e65c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

18
.github/workflows/pr-lint.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Linter
on: [push, pull_request]
jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- run: yarn install
- name: Lint
run: |
npm run lint
env:
CI: true

View File

@ -12,6 +12,7 @@
"profiling": "NODE_ENV=production node --prof lib/index.js",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"lint": "eslint .",
"format": "eslint \"**/*.js\" --fix && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:staged": "eslint \"**/*.js\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"format:check": "eslint \"**/*.js\" && prettier-check \"**/*.{js,json}\"",