Fix linting-messages

This commit is contained in:
Manuel Thalmann 2021-05-10 20:46:32 +00:00
parent 7015fa994a
commit 2dceaf9520
2 changed files with 81 additions and 14 deletions

59
.vscode/tasks.json vendored
View file

@ -7,15 +7,20 @@
"label": "Debug",
"type": "npm",
"script": "build",
"group": "build",
"problemMatcher": "$tsc"
"problemMatcher": [
"$gulp-tsc",
"$node-sass"
]
},
{
"label": "Release",
"type": "npm",
"script": "release",
"group": "build",
"problemMatcher": "$tsc"
"problemMatcher": [
"$gulp-tsc",
"$node-sass"
]
},
{
"label": "Watch Debug",
@ -25,7 +30,24 @@
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc-watch",
"problemMatcher": [
{
"base": "$gulp-tsc",
"background": {
"activeOnStart": false,
"beginsPattern": "^(Starting compilation in watch mode|File change detected. Starting incremental compilation)",
"endsPattern": "^Found \\d+ errors. Watching for file changes."
}
},
{
"base": "$node-sass",
"background": {
"activeOnStart": false,
"beginsPattern": "^Rebuilding scss-code.",
"endsPattern": "^Rebuilding scss-code finished."
}
}
],
"isBackground": true,
"presentation": {
"reveal": "never"
@ -36,7 +58,24 @@
"type": "npm",
"script": "watch-release",
"group": "build",
"problemMatcher": "$tsc-watch",
"problemMatcher": [
{
"base": "$gulp-tsc",
"background": {
"activeOnStart": false,
"beginsPattern": "^(Starting compilation in watch mode|File change detected. Starting incremental compilation)",
"endsPattern": "^Found \\d+ errors. Watching for file changes."
}
},
{
"base": "$node-sass",
"background": {
"activeOnStart": false,
"beginsPattern": "^Rebuilding scss-code.",
"endsPattern": "^Rebuilding scss-code finished."
}
}
],
"isBackground": true,
"presentation": {
"reveal": "never"
@ -64,13 +103,19 @@
"label": "Rebuild",
"type": "npm",
"script": "rebuild",
"problemMatcher": "$tsc"
"problemMatcher": [
"$gulp-tsc",
"$node-sass"
]
},
{
"label": "Rebuild Release",
"type": "npm",
"script": "rebuild-release",
"problemMatcher": "$tsc"
"problemMatcher": [
"$gulp-tsc",
"$node-sass"
]
},
{
"label": "Lint",

View file

@ -260,8 +260,9 @@ export async function Library()
if (!errorMessages.includes(message))
{
let result = new RegExp(`^(${error["fileName"]})\\((\\d+|\\d+(,\\d+){1,3})\\): .* TS([\\d]+): (.*)$`).exec(message);
errorMessages.push(message);
log.error(message);
console.log(`${Path.relative(process.cwd(), result[1])}(${result[2]}): ${result[4]} ${result[5]}`);
}
}
).pipe(
@ -333,6 +334,11 @@ Library.description = "Builds the TypeScript- and JavaScript-library.";
*/
export async function Theme()
{
if (settings.Watch)
{
console.log("Rebuilding scss-code.");
}
return gulp.src(
settings.ThemeSource("main.scss"),
{
@ -341,15 +347,23 @@ export async function Theme()
}).pipe(
sass(
{
importer: require("node-sass-tilde-importer"),
outputStyle: settings.Debug ? "expanded" : "compressed"
importer: require("node-sass-tilde-importer")
}
).on("error",
(error) =>
{
log.error(
`${error.relativePath}:${error.line}:${error.column}\n` +
`${error.messageFormatted}`);
console.log(
JSON.stringify(
{
status: error.status,
file: error.file,
line: error.line,
column: error.column,
message: error.messageOriginal,
formatted: error.formatted
},
null,
4));
})
).pipe(
rename(
@ -367,7 +381,15 @@ export async function Theme()
}
:
undefined)
);
).on(
"end",
() =>
{
if (settings.Watch)
{
console.log("Rebuilding scss-code finished.")
}
});
}
Theme.description = "Builds the theme.";