Skip to content

Commit

Permalink
ci(lint): fix usercss-meta parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Nov 18, 2023
1 parent 610e977 commit efa2e13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/lint/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion template/catppuccin.user.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit efa2e13

Please sign in to comment.