From bf1ed48d3a3d5e21cc416008208e1d37bba085f8 Mon Sep 17 00:00:00 2001 From: Tristan Helmich Date: Tue, 6 Oct 2020 14:15:59 +0000 Subject: [PATCH 1/2] Add workflow to trigger eslint on push/pr --- .github/workflows/eslint.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/eslint.yml diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml new file mode 100644 index 0000000..ec88055 --- /dev/null +++ b/.github/workflows/eslint.yml @@ -0,0 +1,13 @@ +name: Linter +on: [push, pull_request] + +jobs: + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + - run: npm ci + - run: ./node_modules/.bin/eslint -c ./.eslintrc.json -f compact *.js From 493dcadce87cd6e26c8f6ce51906e8d5f5b73f88 Mon Sep 17 00:00:00 2001 From: Tristan Helmich Date: Tue, 6 Oct 2020 14:25:09 +0000 Subject: [PATCH 2/2] Add problem-matchers used by setup-node action --- .github/eslint-compact.json | 18 ++++++++++++++++++ .github/eslint-stylish.json | 22 ++++++++++++++++++++++ .github/tsc.json | 17 +++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 .github/eslint-compact.json create mode 100644 .github/eslint-stylish.json create mode 100644 .github/tsc.json diff --git a/.github/eslint-compact.json b/.github/eslint-compact.json new file mode 100644 index 0000000..72173f0 --- /dev/null +++ b/.github/eslint-compact.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "eslint-compact", + "pattern": [ + { + "regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5, + "code": 6 + } + ] + } + ] +} diff --git a/.github/eslint-stylish.json b/.github/eslint-stylish.json new file mode 100644 index 0000000..1d75d6c --- /dev/null +++ b/.github/eslint-stylish.json @@ -0,0 +1,22 @@ +{ + "problemMatcher": [ + { + "owner": "eslint-stylish", + "pattern": [ + { + "regexp": "^([^\\s].*)$", + "file": 1 + }, + { + "regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$", + "line": 1, + "column": 2, + "severity": 3, + "message": 4, + "code": 5, + "loop": true + } + ] + } + ] +} diff --git a/.github/tsc.json b/.github/tsc.json new file mode 100644 index 0000000..365cf27 --- /dev/null +++ b/.github/tsc.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "tsc", + "pattern": [ + { + "regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$", + "file": 1, + "location": 2, + "severity": 3, + "code": 4, + "message": 5 + } + ] + } + ] +}