ci(lint): fix usercss-meta parse error (#331)

This commit is contained in:
winston authored and GitHub committed 2023-11-18 06:42:42 +01:00
1 parent 610e977d7b
commit f977c5a64c
2 files changed
+14 -2

No files matched your search

+13 -1
View File
@@ -30,7 +30,19 @@ for await (const entry of stylesheets) {
// verify the usercss metadata
const { globalVars, isLess } = await verifyMetadata(entry, content, repo)
.catch(() => ({ globalVars: {}, isLess: false }));
.catch((e) => {
const lines = content.split("\n");
let startLine = -1;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (e.index >= line.length) {
e.index -= line.length;
startLine++;
} else break;
}
log(e.message, { file, startLine, content }, "error");
throw e;
});
// don't attempt to compile or lint non-less files
if (!isLess) continue;
+1 -1
View File
@@ -81,7 +81,7 @@
* The values below are examples and may need to be adapted.
* To apply the correct Theming call the above defined Mixin and pass
* your desired Flavor and Accent Color to it. These are usually
* populated through the `@var`s in the Meta Block. */
* populated through the @vars in the Meta Block. */
// synced colorscheme
@media (prefers-color-scheme: light) {
.no-theme {