diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 000000000..949ca338a --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -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 diff --git a/package.json b/package.json index 5a0fcb32f..73d73a598 100644 --- a/package.json +++ b/package.json @@ -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}\"",