From 0bd36a3b3a3f432aa46530bba07b58c0c7231924 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Tue, 18 Nov 2025 16:45:10 +0000 Subject: [PATCH] disable eslint-disable comments (vibe-kanban) (#1321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Done! All eslint-disable comments are now banned and the codebase is clean. **Summary of changes:** 1. **Installed** `eslint-plugin-eslint-comments` 2. **Updated** [frontend/.eslintrc.cjs](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/2550-disable-eslint-d/frontend/.eslintrc.cjs) to enforce the ban 3. **Fixed 3 files** by refactoring code instead of suppressing rules: - [FeatureShowcaseModal.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/2550-disable-eslint-d/frontend/src/components/showcase/FeatureShowcaseModal.tsx): Added ref to track activeScopes snapshot - [ShareDialog.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/2550-disable-eslint-d/frontend/src/components/dialogs/tasks/ShareDialog.tsx): Added shareTask object to dependencies - [wysiwyg.tsx](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/2550-disable-eslint-d/frontend/src/components/ui/wysiwyg.tsx): Added didInit ref guard for run-once effect All checks pass ✓ * lint fix --- frontend/.eslintrc.cjs | 4 +++- frontend/package.json | 1 + .../components/dialogs/tasks/ShareDialog.tsx | 3 +-- frontend/src/components/ui/wysiwyg.tsx | 8 ++++--- frontend/src/pages/project-tasks.tsx | 5 ++++- pnpm-lock.yaml | 21 +++++++++++++++++++ 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 0c5f2915..768a5cac 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -11,17 +11,19 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:i18next/recommended', + 'plugin:eslint-comments/recommended', 'prettier', ], ignorePatterns: ['dist', '.eslintrc.cjs'], parser: '@typescript-eslint/parser', - plugins: ['react-refresh', '@typescript-eslint', 'unused-imports', 'i18next'], + plugins: ['react-refresh', '@typescript-eslint', 'unused-imports', 'i18next', 'eslint-comments'], parserOptions: { ecmaVersion: 'latest', sourceType: 'module', project: './tsconfig.json', }, rules: { + 'eslint-comments/no-use': ['error', { allow: [] }], 'react-refresh/only-export-components': 'off', 'unused-imports/no-unused-imports': 'error', 'unused-imports/no-unused-vars': [ diff --git a/frontend/package.json b/frontend/package.json index a8a2b568..35426e89 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -96,6 +96,7 @@ "autoprefixer": "^10.4.16", "eslint": "^8.55.0", "eslint-config-prettier": "^10.1.5", + "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-i18next": "^6.1.3", "eslint-plugin-prettier": "^5.5.0", "eslint-plugin-react-hooks": "^4.6.0", diff --git a/frontend/src/components/dialogs/tasks/ShareDialog.tsx b/frontend/src/components/dialogs/tasks/ShareDialog.tsx index 42176ada..40a2f199 100644 --- a/frontend/src/components/dialogs/tasks/ShareDialog.tsx +++ b/frontend/src/components/dialogs/tasks/ShareDialog.tsx @@ -39,8 +39,7 @@ const ShareDialogImpl = NiceModal.create(({ task }) => { useEffect(() => { shareTask.reset(); setShareError(null); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [task.id, shareTask.reset]); + }, [task.id, shareTask]); const handleClose = () => { modal.resolve(shareTask.isSuccess); diff --git a/frontend/src/components/ui/wysiwyg.tsx b/frontend/src/components/ui/wysiwyg.tsx index 90eccb75..446613fc 100644 --- a/frontend/src/components/ui/wysiwyg.tsx +++ b/frontend/src/components/ui/wysiwyg.tsx @@ -193,13 +193,15 @@ function MarkdownDefaultValuePlugin({ lastMdRef: React.MutableRefObject; }) { const [editor] = useLexicalComposerContext(); + const didInit = useRef(false); useEffect(() => { - // Apply once on mount + if (didInit.current) return; + didInit.current = true; + editor.update(() => { $convertFromMarkdownString(defaultValue || '', importTransformers); }); lastMdRef.current = defaultValue || ''; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [editor]); // do not depend on defaultValue to ensure it's one-time + }, [editor, defaultValue, importTransformers, lastMdRef]); return null; } diff --git a/frontend/src/pages/project-tasks.tsx b/frontend/src/pages/project-tasks.tsx index b77b0856..0651316e 100644 --- a/frontend/src/pages/project-tasks.tsx +++ b/frontend/src/pages/project-tasks.tsx @@ -205,7 +205,10 @@ export function ProjectTasks() { const isLoaded = !loading; const showcaseId = showcases.taskPanel.id; - const seenFeatures = config?.showcases?.seen_features ?? []; + const seenFeatures = useMemo( + () => config?.showcases?.seen_features ?? [], + [config?.showcases?.seen_features] + ); const seen = isLoaded && seenFeatures.includes(showcaseId); useEffect(() => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6069520a..61b69c70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -255,6 +255,9 @@ importers: eslint-config-prettier: specifier: ^10.1.5 version: 10.1.5(eslint@8.57.1) + eslint-plugin-eslint-comments: + specifier: ^3.2.0 + version: 3.2.0(eslint@8.57.1) eslint-plugin-i18next: specifier: ^6.1.3 version: 6.1.3 @@ -2321,6 +2324,10 @@ packages: escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -2331,6 +2338,12 @@ packages: peerDependencies: eslint: '>=7.0.0' + eslint-plugin-eslint-comments@3.2.0: + resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} + engines: {node: '>=6.5.0'} + peerDependencies: + eslint: '>=4.19.1' + eslint-plugin-i18next@6.1.3: resolution: {integrity: sha512-z/h4oBRd9wI1ET60HqcLSU6XPeAh/EPOrBBTyCdkWeMoYrWAaUVA+DOQkWTiNIyCltG4NTmy62SQisVXxoXurw==} engines: {node: '>=18.10.0'} @@ -5804,12 +5817,20 @@ snapshots: escape-html@1.0.3: {} + escape-string-regexp@1.0.5: {} + escape-string-regexp@4.0.0: {} eslint-config-prettier@10.1.5(eslint@8.57.1): dependencies: eslint: 8.57.1 + eslint-plugin-eslint-comments@3.2.0(eslint@8.57.1): + dependencies: + escape-string-regexp: 1.0.5 + eslint: 8.57.1 + ignore: 5.3.2 + eslint-plugin-i18next@6.1.3: dependencies: lodash: 4.17.21