Skip to content

Commit

Permalink
fix: url docs for error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Oct 17, 2024
1 parent 2ce36ff commit 2f8a5ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-planes-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kitajs/ts-html-plugin': patch
---

Fixed url docs for error codes
15 changes: 8 additions & 7 deletions packages/ts-html-plugin/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
function urlDocs(error: `k${number}`) {
return `https://html.kitajs.org/packages/ts-html-plugin#${error}`;
}

export const Xss = {
code: '0 K601' as any,
message:
'Usage of xss-prone content without `safe` attribute. https://kitajs.github.io/ts-html-plugin#k601'
message: `Usage of xss-prone content without \`safe\` attribute. ${urlDocs('k601')}`
};

export const DoubleEscape = {
code: '0 K602' as any,
message:
'Double escaping detected. Please remove the `safe` attribute. https://kitajs.github.io/ts-html-plugin#k602'
message: `Double escaping detected. Please remove the \`safe\` attribute. ${urlDocs('k602')}`
};

export const ComponentXss = {
code: '0 K603' as any,
message:
'Xss-prone content inside a Component, wrap it into a Html.escapeHtml() call. https://kitajs.github.io/ts-html-plugin#k603'
message: `Xss-prone content inside a Component, wrap it into a Html.escapeHtml() call. ${urlDocs('k603')}`
};

export const UnusedSafe = {
code: '0 K604' as any,
message: 'Unused safe attribute. https://kitajs.github.io/ts-html-plugin#k604'
message: `Unused safe attribute. ${urlDocs('k604')}`
};

0 comments on commit 2f8a5ec

Please sign in to comment.