mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 23:27:14 +00:00
fix: add lint line for reference
This commit is contained in:
@@ -11,6 +11,7 @@ import { useGetFoldersByEnv } from "@app/hooks/api/secretFolders/queries";
|
|||||||
import { useGetProjectSecrets } from "@app/hooks/api/secrets/queries";
|
import { useGetProjectSecrets } from "@app/hooks/api/secrets/queries";
|
||||||
|
|
||||||
const REGEX_REFERENCE = /(\${([^}]*)})/g;
|
const REGEX_REFERENCE = /(\${([^}]*)})/g;
|
||||||
|
const REGEX_REFERENCE_INVALID = /(?:\/|\\|\n|\.$|^\.)/g
|
||||||
const replaceContentWithDot = (str: string) => {
|
const replaceContentWithDot = (str: string) => {
|
||||||
let finalStr = "";
|
let finalStr = "";
|
||||||
for (let i = 0; i < str.length; i += 1) {
|
for (let i = 0; i < str.length; i += 1) {
|
||||||
@@ -32,7 +33,12 @@ const syntaxHighlight = (content?: string | null, isVisible?: boolean) => {
|
|||||||
skipNext = true;
|
skipNext = true;
|
||||||
return (
|
return (
|
||||||
<span className="ph-no-capture text-yellow" key={`secret-value-${i + 1}`}>
|
<span className="ph-no-capture text-yellow" key={`secret-value-${i + 1}`}>
|
||||||
${<span className="ph-no-capture text-yellow-200/80">{el.slice(2, -1)}</span>
|
${<span
|
||||||
|
className={twMerge(
|
||||||
|
"ph-no-capture text-yellow-200/80",
|
||||||
|
REGEX_REFERENCE_INVALID.test(el.slice(2, -1)) && "underline decoration-wavy decoration-red"
|
||||||
|
)}
|
||||||
|
>{el.slice(2, -1)}</span>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user