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:
Danny Avila 2023-07-14 09:36:49 -04:00 committed by GitHub
parent 637bb6bc11
commit e5336039fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
231 changed files with 1688 additions and 1526 deletions

View file

@ -62,10 +62,10 @@ const Content = React.memo(({ content, message }) => {
{
detect: true,
ignoreMissing: true,
subset: langSubset
}
subset: langSubset,
},
],
[rehypeRaw]
[rehypeRaw],
];
if (!isInitializing || !isLatestMessage) {
@ -79,7 +79,7 @@ const Content = React.memo(({ content, message }) => {
linkTarget="_new"
components={{
code,
p
p,
}}
>
{isLatestMessage && isSubmitting && !isInitializing ? (content ?? '') + cursor : content}

View file

@ -12,7 +12,7 @@ export default function HoverButtons({
conversation,
isSubmitting,
message,
regenerate
regenerate,
}) {
const { endpoint } = conversation;
const [isCopied, setIsCopied] = React.useState(false);
@ -20,7 +20,7 @@ export default function HoverButtons({
const branchingSupported =
// azureOpenAI, openAI, chatGPTBrowser support branching, so edit enabled // 5/21/23: Bing is allowing editing and Message regenerating
!!['azureOpenAI', 'openAI', 'chatGPTBrowser', 'google', 'bingAI', 'gptPlugins', 'anthropic'].find(
(e) => e === endpoint
(e) => e === endpoint,
);
// Sydney in bingAI supports branching, so edit enabled
@ -68,7 +68,7 @@ export default function HoverButtons({
<button
className={cn(
'hover-button rounded-md p-1 hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 disabled:dark:hover:text-gray-400 md:invisible md:group-hover:visible',
message?.isCreatedByUser ? '' : 'active'
message?.isCreatedByUser ? '' : 'active',
)}
onClick={() => copyToClipboard(setIsCopied)}
type="button"

View file

@ -23,7 +23,7 @@ export default function Message({
setCurrentEditId,
siblingIdx,
siblingCount,
setSiblingIdx
setSiblingIdx,
}) {
const { text, searchResult, isCreatedByUser, error, submitting, unfinished } = message;
const isSubmitting = useRecoilValue(store.isSubmitting);
@ -36,7 +36,7 @@ export default function Message({
const { switchToConversation } = store.useConversation();
const blinker = submitting && isSubmitting;
const getConversationQuery = useGetConversationByIdQuery(message.conversationId, {
enabled: false
enabled: false,
});
// debugging
@ -69,13 +69,13 @@ export default function Message({
const props = {
className:
'w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 bg-white dark:text-gray-100 group dark:bg-gray-800'
'w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 bg-white dark:text-gray-100 group dark:bg-gray-800',
};
const icon = getIcon({
...conversation,
...message,
model: message?.model || conversation?.model
model: message?.model || conversation?.model,
});
if (!isCreatedByUser)
@ -93,7 +93,7 @@ export default function Message({
ask({
text,
parentMessageId: message?.parentMessageId,
conversationId: message?.conversationId
conversationId: message?.conversationId,
});
setSiblingIdx(siblingCount - 1);
@ -185,7 +185,7 @@ export default function Message({
<div
className={cn(
'flex min-h-[20px] flex-grow flex-col items-start gap-4 ',
isCreatedByUser ? 'whitespace-pre-wrap' : ''
isCreatedByUser ? 'whitespace-pre-wrap' : '',
)}
>
{/* <div className={`${blinker ? 'result-streaming' : ''} markdown prose dark:prose-invert light w-full break-words`}> */}
@ -209,7 +209,7 @@ export default function Message({
{!isSubmitting && unfinished ? (
<div className="flex flex min-h-[20px] flex-grow flex-col items-start gap-2 gap-4 text-red-500">
<div className="rounded-md border border-blue-400 bg-blue-500/10 px-3 py-2 text-sm text-gray-600 dark:text-gray-100">
{`This is an unfinished message. The AI may still be generating a response or it was aborted. Refresh or visit later to see more updates.`}
{'This is an unfinished message. The AI may still be generating a response or it was aborted. Refresh or visit later to see more updates.'}
</div>
</div>
) : null}

View file

@ -63,7 +63,7 @@ const MessageHeader = ({ isSearchView = false }) => {
<div
className={cn(
'dark:text-gray-450 w-full gap-1 border-b border-black/10 bg-gray-50 text-sm text-gray-500 transition-all hover:bg-gray-100 hover:bg-opacity-30 dark:border-gray-900/50 dark:bg-gray-700 dark:hover:bg-gray-600 dark:hover:bg-opacity-100 dark:text-gray-500',
isNotClickable ? '' : 'cursor-pointer '
isNotClickable ? '' : 'cursor-pointer ',
)}
onClick={() => (isNotClickable ? null : setSaveAsDialogShow(true))}
>

View file

@ -10,7 +10,7 @@ export default function MultiMessage({
scrollToBottom,
currentEditId,
setCurrentEditId,
isSearchView
isSearchView,
}) {
// const [siblingIdx, setSiblingIdx] = useState(0);

View file

@ -35,7 +35,7 @@ export default function Plugin({ plugin }) {
if (!loading && plugin.latest === 'Self Reflection') {
return 'Finished';
} else if (plugin.latest === 'Self Reflection') {
return "I'm thinking...";
return 'I\'m thinking...';
} else {
return (
<>
@ -54,7 +54,7 @@ export default function Plugin({ plugin }) {
<div
className={cn(
loading ? 'bg-green-100' : 'bg-[#ECECF1]',
'flex items-center rounded p-3 text-sm text-gray-900'
'flex items-center rounded p-3 text-sm text-gray-900',
)}
>
<div>

View file

@ -63,9 +63,9 @@ export default function Messages({ isSearchView = false }) {
setShowScrollButton(false);
},
750,
{ leading: true }
{ leading: true },
),
[messagesEndRef]
[messagesEndRef],
);
let timeoutId = null;