diff --git a/apps/color-buddy/src/linting/Eval.svelte b/apps/color-buddy/src/linting/Eval.svelte index 932d741..bbeb225 100644 --- a/apps/color-buddy/src/linting/Eval.svelte +++ b/apps/color-buddy/src/linting/Eval.svelte @@ -54,104 +54,116 @@ $: isCompact = displayMode === "compact"; let innerWidth = window.innerWidth; + + function refreshLints() { + const outPal = { + ...currentPal, + evalConfig: { + ...currentPal.evalConfig, + globallyIgnoredLints: $colorStore.globallyIgnoredLints, + }, + }; + loadLints() + .then(() => lint(outPal, false)) + .then((res) => { + lintResults = res; + }); + } +{#if displayMode === "check-customization"} + refreshLints()} /> +{/if}
- {#if displayMode === "check-customization"} - - {:else} -
-
-
- -
-
- This collection of checks validates whether or not your palette - matches a number of commonly held beliefs about best practices. They - wont fit every situation. -
- {#each Object.keys(lintGroupNames).filter((x) => (lintGroups[x] || []).length) as lintGroup} -
-
-
- Logo for {lintGroup} -
-
{lintGroupNames[lintGroup]}
+
+
+
+ This collection of checks validates whether or not your palette matches + a number of commonly held beliefs about best practices. They wont fit + every situation. +
+ {#each Object.keys(lintGroupNames).filter((x) => (lintGroups[x] || []).length) as lintGroup} +
+
+
+ Logo for {lintGroup}
+
{lintGroupNames[lintGroup]}
+
+ + {#if (lintGroups[lintGroup] || []).some((x) => evalConfig[x.lintProgram.name]?.ignore)} - {#if (lintGroups[lintGroup] || []).some((x) => evalConfig[x.lintProgram.name]?.ignore)} - - {/if} -
-
- {#if isCompact} - {#each lintGroups[lintGroup] || [] as lintResult} - {#if lintResult.kind === "success" && !lintResult.passes} - - {/if} - {/each} - {/if} -
-
+ {/if} +
+
+ {#if isCompact} {#each lintGroups[lintGroup] || [] as lintResult} - {#if !isCompact || (isCompact && lintResult.kind === "success" && !lintResult.passes)} - + {#if lintResult.kind === "success" && !lintResult.passes} + {/if} {/each} -
- {#if (lintGroups[lintGroup] || []).length === 0 && $lintStore.loadState === "loading"} -
Loading
{/if} - {/each} -
+
+
+ {#each lintGroups[lintGroup] || [] as lintResult} + {#if !isCompact || (isCompact && lintResult.kind === "success" && !lintResult.passes)} + + {/if} + {/each} +
+ {#if (lintGroups[lintGroup] || []).length === 0 && $lintStore.loadState === "loading"} +
Loading
+ {/if} + {/each}
- {/if} +
+
diff --git a/apps/color-buddy/src/linting/LintCustomizationTab.svelte b/apps/color-buddy/src/linting/LintCustomizationTab.svelte index e2f260d..91529b9 100644 --- a/apps/color-buddy/src/linting/LintCustomizationTab.svelte +++ b/apps/color-buddy/src/linting/LintCustomizationTab.svelte @@ -5,6 +5,8 @@ import type { LintResult, LintProgram } from "color-buddy-palette-lint"; import colorStore from "../stores/color-store"; + import configStore from "../stores/config-store"; + import Tooltip from "../components/Tooltip.svelte"; import MonacoEditor from "../components/MonacoEditor.svelte"; @@ -13,11 +15,13 @@ import { buttonStyle } from "../lib/styles"; import { JSONStringify } from "../lib/utils"; import { lintGroupNames, typeToImg } from "../constants"; + import Modal from "../components/Modal.svelte"; import LintCustomizationPreview from "./LintCustomizationPreview.svelte"; import NewLintSuggestion from "./NewLintSuggestion.svelte"; import LintCustomizationAddTest from "./LintCustomizationAddTest.svelte"; - export let maxWidth: number; + + export let onClose: () => void; $: lint = $lintStore.lints.find( (lint) => lint.id === $lintStore.focusedLint @@ -114,124 +118,83 @@ ); -{#if !lint} -
- -
- {#each Object.keys(lintGroupNames) as lintGroup} -
-
- Logo for {lintGroup} -
-
{lintGroupNames[lintGroup]}
-
- {#each sortedLintsByGroup[lintGroup] || [] as lint} - - {/each} - {/each} + { + configStore.setEvalDisplayMode("regular"); + onClose(); + }} +> + {#if !lint} +
+
Pick a Check to Customize
+
-
-{/if} - -{#if lint} -
- -
- - {#if isBuiltInThatsBeenModified} - - {/if} -
- {#if showDeleteDoubleCheck} +
+
+ {#each Object.keys(lintGroupNames) as lintGroup}
-
Are you sure you want to delete this lint?
+
+ Logo for {lintGroup} +
+
{lintGroupNames[lintGroup]}
+
+ {#each sortedLintsByGroup[lintGroup] || [] as lint} - -
- {:else} - - {/if} + {/each} + {/each} +
+
+ {/if} + + {#if lint} +
+ +
+ Customize Check + - - Docs -
-
-
- -
-
Lint Name:
- { - // @ts-ignore - const name = e.target.value; - lintStore.setCurrentLintName(name); - }} - /> -
-
-
+
+ +
+
Name:
+ { + // @ts-ignore + const name = e.target.value; + lintStore.setCurrentLintName(name); + }} + /> +
+
+ -
-
Task Types:
-
- {#each taskTypes as taskType} -
-
--> +
+
Group:
+ +
+ +
+
Task Types:
+
+ {#each taskTypes as taskType} +
+ +
+ {/each} +
+
+ +
+
+
Required Tags
+ + + +
+
{ + lintStore.setCurrentTags([ + ...lint.requiredTags, + requiredTagAdd, + ]); + requiredTagAdd = ""; }} - /> - {taskType} - -
- {/each} + > + + +
+ +
+
+ {#each lint.requiredTags as tag} +
+ {tag} + +
+ {/each} +
- -
+
+ {#if isBuiltInThatsBeenModified} + + {/if}
-
Required Tags
- - - -
-
{ - lintStore.setCurrentTags([ - ...lint.requiredTags, - requiredTagAdd, - ]); - requiredTagAdd = ""; + {#if showDeleteDoubleCheck} +
+
Are you sure you want to delete this check?
+
- -
-
- {#each lint.requiredTags as tag} -
- {tag} + Yes +
- {/each} + {:else} + + {/if} + + + Docs +
-
-
-
Lint Description:
-