Add eslint problem matchers (#10)

* Add eslint problem matchers

* Use absolute paths
This commit is contained in:
Danny McCormick 2019-06-18 10:50:43 -04:00 committed by GitHub
parent 82902559de
commit e2d9812c04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 2 deletions

18
.github/eslint-compact.json vendored Normal file
View file

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "tsc",
"pattern": [
{
"regexp": "/^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$/",
"file": 1,
"line": 2,
"character": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}

40
.github/eslint-stylish.json vendored Normal file
View file

@ -0,0 +1,40 @@
{
"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
}
]
},
{
"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
}
]
}
]
}

View file

@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const installer = __importStar(require("./installer")); const installer = __importStar(require("./installer"));
const path = __importStar(require("path"));
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -30,7 +31,10 @@ function run() {
yield installer.getNode(version); yield installer.getNode(version);
} }
// TODO: setup proxy from runner proxy config // TODO: setup proxy from runner proxy config
console.log('##[add-matcher].github/tsc.json'); const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`);
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View file

@ -1,5 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as installer from './installer'; import * as installer from './installer';
import * as path from 'path';
async function run() { async function run() {
try { try {
@ -14,7 +15,14 @@ async function run() {
} }
// TODO: setup proxy from runner proxy config // TODO: setup proxy from runner proxy config
console.log('##[add-matcher].github/tsc.json'); const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
console.log(
`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`
);
console.log(
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
);
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
} }