- Remove unused eslint-disable directive in preset swatches - Add safe eslint-disable for controlled bgKey lookup in ColorField renderer
This commit is contained in:
1 parent
acc820284b
commit
cb4a6a8f3e
1 file changed
+1
-1
@@ -87,6 +87,7 @@ function colorFields(
|
|||||||
{fields.map((f) => {
|
{fields.map((f) => {
|
||||||
const val = toHex(current[f.key], f.def);
|
const val = toHex(current[f.key], f.def);
|
||||||
const bgKey = f.bgKey ? `${f.bgKey}${suffix}` : undefined;
|
const bgKey = f.bgKey ? `${f.bgKey}${suffix}` : undefined;
|
||||||
|
// eslint-disable-next-line security/detect-object-injection -- bgKey derived from hardcoded field list
|
||||||
const bgValue = bgKey ? toHex(current[bgKey], "") : undefined;
|
const bgValue = bgKey ? toHex(current[bgKey], "") : undefined;
|
||||||
return (
|
return (
|
||||||
<ColorField
|
<ColorField
|
||||||
@@ -178,7 +179,6 @@ export default async function AdminTheme({
|
|||||||
width: 14,
|
width: 14,
|
||||||
height: 14,
|
height: 14,
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
// eslint-disable-next-line security/detect-object-injection -- k from hardcoded array
|
|
||||||
background: palette.light[k as keyof typeof palette.light],
|
background: palette.light[k as keyof typeof palette.light],
|
||||||
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.15)",
|
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.15)",
|
||||||
marginLeft: -3,
|
marginLeft: -3,
|
||||||
|
|||||||
Reference in new issue
Block a user