mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-11 03:54:23 +01:00
ci(backend-review.yml): add linter step to the backend review workflow (#625)
* ci(backend-review.yml): add linter step to the backend review workflow * chore(backend-review.yml): remove prettier from lint-action configuration * chore: apply new linting workflow * chore(lint-staged.config.js): reorder lint-staged tasks for JavaScript and TypeScript files * chore(eslint): update ignorePatterns in .eslintrc.js chore(lint-action): remove prettier option in backend-review.yml chore(package.json): add lint and lint:fix scripts * chore(lint-staged.config.js): remove prettier --write command for js, jsx, ts, tsx files * chore(titleConvo.js): remove unnecessary console.log statement chore(titleConvo.js): add missing comma in options object * chore: apply linting to all files * chore(lint-staged.config.js): update lint-staged configuration to include prettier formatting
This commit is contained in:
parent
637bb6bc11
commit
e5336039fc
231 changed files with 1688 additions and 1526 deletions
|
|
@ -6,7 +6,7 @@ import {
|
|||
atomFamily,
|
||||
useSetRecoilState,
|
||||
useResetRecoilState,
|
||||
useRecoilCallback
|
||||
useRecoilCallback,
|
||||
} from 'recoil';
|
||||
import buildTree from '~/utils/buildTree';
|
||||
import getDefaultConversation from '~/utils/getDefaultConversation';
|
||||
|
|
@ -14,7 +14,7 @@ import submission from './submission.js';
|
|||
|
||||
const conversation = atom({
|
||||
key: 'conversation',
|
||||
default: null
|
||||
default: null,
|
||||
});
|
||||
|
||||
// current messages of the conversation, must be an array
|
||||
|
|
@ -22,24 +22,24 @@ const conversation = atom({
|
|||
// [{text, sender, messageId, parentMessageId, isCreatedByUser}]
|
||||
const messages = atom({
|
||||
key: 'messages',
|
||||
default: []
|
||||
default: [],
|
||||
});
|
||||
|
||||
const messagesTree = selector({
|
||||
key: 'messagesTree',
|
||||
get: ({ get }) => {
|
||||
return buildTree(get(messages), false);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const latestMessage = atom({
|
||||
key: 'latestMessage',
|
||||
default: null
|
||||
default: null,
|
||||
});
|
||||
|
||||
const messagesSiblingIdxFamily = atomFamily({
|
||||
key: 'messagesSiblingIdx',
|
||||
default: 0
|
||||
default: 0,
|
||||
});
|
||||
|
||||
const useConversation = () => {
|
||||
|
|
@ -52,7 +52,7 @@ const useConversation = () => {
|
|||
conversation,
|
||||
messages = null,
|
||||
preset = null,
|
||||
{ endpointsConfig = {}, prevConversation = {} }
|
||||
{ endpointsConfig = {}, prevConversation = {} },
|
||||
) => {
|
||||
let { endpoint = null } = conversation;
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ const useConversation = () => {
|
|||
conversation,
|
||||
endpointsConfig,
|
||||
prevConversation,
|
||||
preset
|
||||
preset,
|
||||
});
|
||||
|
||||
setConversation(conversation);
|
||||
|
|
@ -78,10 +78,10 @@ const useConversation = () => {
|
|||
const endpointsConfig = await snapshot.getPromise(endpoints.endpointsConfig);
|
||||
_switchToConversation(_conversation, messages, preset, {
|
||||
endpointsConfig,
|
||||
prevConversation
|
||||
prevConversation,
|
||||
});
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
const newConversation = useCallback((template = {}, preset) => {
|
||||
|
|
@ -89,10 +89,10 @@ const useConversation = () => {
|
|||
{
|
||||
conversationId: 'new',
|
||||
title: 'New Chat',
|
||||
...template
|
||||
...template,
|
||||
},
|
||||
[],
|
||||
preset
|
||||
preset,
|
||||
);
|
||||
}, [switchToConversation]);
|
||||
|
||||
|
|
@ -100,9 +100,9 @@ const useConversation = () => {
|
|||
switchToConversation(
|
||||
{
|
||||
conversationId: 'search',
|
||||
title: 'Search'
|
||||
title: 'Search',
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -115,5 +115,5 @@ export default {
|
|||
messagesTree,
|
||||
latestMessage,
|
||||
messagesSiblingIdxFamily,
|
||||
useConversation
|
||||
useConversation,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue