From 26e50bb084c3014f7aa8fb602124e04647006f97 Mon Sep 17 00:00:00 2001 From: Jean Ibarz Date: Mon, 20 Apr 2026 03:41:32 +0200 Subject: [PATCH] =?UTF-8?q?refactor(web):=20convert=20file-local=20Step=20?= =?UTF-8?q?enum=20to=20as-const=20in=20website=20crawlers=20=F0=9F=A4=96?= =?UTF-8?q?=F0=9F=A4=96=F0=9F=A4=96=20(#34565)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Claude Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- eslint-suppressions.json | 9 --------- .../datasets/create/website/firecrawl/index.tsx | 11 ++++++----- .../datasets/create/website/jina-reader/index.tsx | 11 ++++++----- .../datasets/create/website/watercrawl/index.tsx | 11 ++++++----- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 29fcf2634e..32de602651 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -2449,9 +2449,6 @@ } }, "web/app/components/datasets/create/website/firecrawl/index.tsx": { - "erasable-syntax-only/enums": { - "count": 1 - }, "no-console": { "count": 1 }, @@ -2468,9 +2465,6 @@ } }, "web/app/components/datasets/create/website/jina-reader/index.tsx": { - "erasable-syntax-only/enums": { - "count": 1 - }, "no-console": { "count": 1 }, @@ -2487,9 +2481,6 @@ } }, "web/app/components/datasets/create/website/watercrawl/index.tsx": { - "erasable-syntax-only/enums": { - "count": 1 - }, "no-console": { "count": 1 }, diff --git a/web/app/components/datasets/create/website/firecrawl/index.tsx b/web/app/components/datasets/create/website/firecrawl/index.tsx index 33aa43b402..4f6077d6cc 100644 --- a/web/app/components/datasets/create/website/firecrawl/index.tsx +++ b/web/app/components/datasets/create/website/firecrawl/index.tsx @@ -27,11 +27,12 @@ type Props = { crawlOptions: CrawlOptions onCrawlOptionsChange: (payload: CrawlOptions) => void } -enum Step { - init = 'init', - running = 'running', - finished = 'finished', -} +const Step = { + init: 'init', + running: 'running', + finished: 'finished', +} as const +type Step = typeof Step[keyof typeof Step] type CrawlState = { current: number total: number diff --git a/web/app/components/datasets/create/website/jina-reader/index.tsx b/web/app/components/datasets/create/website/jina-reader/index.tsx index 0beee86103..3dc3505bb4 100644 --- a/web/app/components/datasets/create/website/jina-reader/index.tsx +++ b/web/app/components/datasets/create/website/jina-reader/index.tsx @@ -27,11 +27,12 @@ type Props = { crawlOptions: CrawlOptions onCrawlOptionsChange: (payload: CrawlOptions) => void } -enum Step { - init = 'init', - running = 'running', - finished = 'finished', -} +const Step = { + init: 'init', + running: 'running', + finished: 'finished', +} as const +type Step = typeof Step[keyof typeof Step] const JinaReader: FC = ({ onPreview, checkedCrawlResult, onCheckedCrawlResultChange, onJobIdChange, crawlOptions, onCrawlOptionsChange }) => { const { t } = useTranslation() const [step, setStep] = useState(Step.init) diff --git a/web/app/components/datasets/create/website/watercrawl/index.tsx b/web/app/components/datasets/create/website/watercrawl/index.tsx index d8e3c6c067..6228547966 100644 --- a/web/app/components/datasets/create/website/watercrawl/index.tsx +++ b/web/app/components/datasets/create/website/watercrawl/index.tsx @@ -27,11 +27,12 @@ type Props = { crawlOptions: CrawlOptions onCrawlOptionsChange: (payload: CrawlOptions) => void } -enum Step { - init = 'init', - running = 'running', - finished = 'finished', -} +const Step = { + init: 'init', + running: 'running', + finished: 'finished', +} as const +type Step = typeof Step[keyof typeof Step] const WaterCrawl: FC = ({ onPreview, checkedCrawlResult, onCheckedCrawlResultChange, onJobIdChange, crawlOptions, onCrawlOptionsChange }) => { const { t } = useTranslation() const [step, setStep] = useState(Step.init)