Fix linter issues

This commit is contained in:
Alex Gleason committed 2025-11-06 14:33:10 -06:00
1 parent 0bcb45270f
commit c474cd5c6c
3 files changed
+29 -17

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { useQuery } from '@tanstack/react-query';
import { useFS } from './useFS';
import { useFSPaths } from './useFSPaths';
import { getPluginGitInfo } from '@/lib/plugins';
/**
* Hook to get git info for a specific plugin
*/
export function usePluginGitInfo(pluginName: string) {
const { fs } = useFS();
const { pluginsPath } = useFSPaths();
return useQuery({
queryKey: ['plugin-git-info', pluginsPath, pluginName],
queryFn: async () => {
return await getPluginGitInfo(fs, pluginsPath, pluginName);
},
enabled: !!pluginName,
});
}
+5 -12
View File
@@ -1,7 +1,7 @@
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { useFS } from './useFS';
import { useFSPaths } from './useFSPaths';
import { getPlugins, getAllSkills, deletePlugin as deletePluginFn, getPluginGitInfo, type PluginGitInfo } from '@/lib/plugins';
import { getPlugins, getAllSkills, deletePlugin as deletePluginFn } from '@/lib/plugins';
import { useGit } from './useGit';
import { join } from 'path-browserify';
@@ -91,6 +91,10 @@ export function usePlugins() {
dir: pluginDir,
singleBranch: true,
fastForward: true,
author: {
name: 'shakespeare.diy',
email: '[email protected]',
},
});
return pluginName;
@@ -115,16 +119,6 @@ export function usePlugins() {
},
});
// Function to get git info for a specific plugin
const getPluginGitInfoQuery = (pluginName: string) => {
return useQuery({
queryKey: ['plugin-git-info', pluginsPath, pluginName],
queryFn: async () => {
return await getPluginGitInfo(fs, pluginsPath, pluginName);
},
});
};
return {
plugins: pluginsQuery.data || [],
isLoadingPlugins: pluginsQuery.isLoading,
@@ -133,6 +127,5 @@ export function usePlugins() {
clonePlugin,
syncPlugin,
deletePlugin,
getPluginGitInfo: getPluginGitInfoQuery,
};
}