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

@ -17,7 +17,7 @@ export default function ModelItem({ endpoint, value, isSelected }) {
endpoint,
error: false,
className: 'mr-2',
message: false
message: false,
});
const isUserProvided = endpointsConfig?.[endpoint]?.userProvide;
@ -29,7 +29,7 @@ export default function ModelItem({ endpoint, value, isSelected }) {
value={value}
className={cn(
'group dark:font-semibold dark:text-gray-100 dark:hover:bg-gray-800',
isSelected && 'dark:bg-gray-800 bg-gray-50 active'
isSelected && 'dark:bg-gray-800 bg-gray-50 active',
)}
id={endpoint}
>
@ -45,7 +45,7 @@ export default function ModelItem({ endpoint, value, isSelected }) {
<button
className={cn(
'invisible m-0 mr-1 flex-initial rounded-md p-0 text-xs font-medium text-gray-400 hover:text-gray-700 group-hover:visible dark:font-normal dark:text-gray-400 dark:hover:text-gray-200',
isSelected && 'visible text-gray-700 dark:text-gray-200'
isSelected && 'visible text-gray-700 dark:text-gray-200',
)}
onClick={(e) => {
e.preventDefault();

View file

@ -4,7 +4,13 @@ export default function EndpointItems({ endpoints, onSelect, selectedEndpoint })
return (
<>
{endpoints.map((endpoint) => (
<EndpointItem isSelected={selectedEndpoint === endpoint} key={endpoint} value={endpoint} onSelect={onSelect} endpoint={endpoint} />
<EndpointItem
isSelected={selectedEndpoint === endpoint}
key={endpoint}
value={endpoint}
onSelect={onSelect}
endpoint={endpoint}
/>
))}
</>
);

View file

@ -19,7 +19,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
invalidText = null,
validator = null,
text = null,
id = '1'
id = '1',
}) => {
const [statusColor, setStatusColor] = useState<string>('text-gray-600');
const [status, setStatus] = useState<null | string>(null);
@ -52,7 +52,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
htmlFor={`file-upload-${id}`}
className={cn(
'mr-1 flex h-auto cursor-pointer items-center rounded bg-transparent px-2 py-1 text-xs font-medium font-normal transition-colors hover:bg-slate-200 hover:text-green-700 dark:bg-transparent dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-green-500',
statusColor
statusColor,
)}
>
<FileUp className="mr-1 flex w-[22px] items-center stroke-1" />

View file

@ -11,7 +11,7 @@ export default function PresetItem({ preset = {}, value, onChangePreset, onDelet
endpoint: preset?.endpoint,
model: preset?.model,
error: false,
className: 'mr-2'
className: 'mr-2',
});
const getPresetTitle = () => {
@ -28,7 +28,7 @@ export default function PresetItem({ preset = {}, value, onChangePreset, onDelet
} else if (endpoint === 'bingAI') {
const { jailbreak, toneStyle } = preset;
if (toneStyle) _title += `: ${toneStyle}`;
if (jailbreak) _title += ` as Sydney`;
if (jailbreak) _title += ' as Sydney';
} else if (endpoint === 'chatGPTBrowser') {
const { model } = preset;
if (model) _title += `: ${model}`;

View file

@ -20,7 +20,7 @@ import {
DropdownMenuTrigger,
DialogTemplate,
Dialog,
DialogTrigger
DialogTrigger,
} from '../../ui/';
import { cn } from '~/utils/';
@ -54,8 +54,8 @@ export default function NewConversationMenu() {
},
onError: (error) => {
console.error('Error uploading the preset:', error);
}
}
},
},
);
};
@ -79,7 +79,7 @@ export default function NewConversationMenu() {
const lastSelectedModel = JSON.parse(localStorage.getItem('lastSelectedModel')) || {};
localStorage.setItem(
'lastSelectedModel',
JSON.stringify({ ...lastSelectedModel, [endpoint]: conversation.model })
JSON.stringify({ ...lastSelectedModel, [endpoint]: conversation.model }),
);
localStorage.setItem('lastConversationSetup', JSON.stringify(conversation));
}
@ -89,7 +89,7 @@ export default function NewConversationMenu() {
const { jailbreak, toneStyle } = conversation;
localStorage.setItem(
'lastBingSettings',
JSON.stringify({ ...lastBingSettings, jailbreak, toneStyle })
JSON.stringify({ ...lastBingSettings, jailbreak, toneStyle }),
);
}
}, [conversation]);
@ -112,7 +112,7 @@ export default function NewConversationMenu() {
const currentConvo = getDefaultConversation({
conversation,
endpointsConfig,
preset: newPreset
preset: newPreset,
});
setConversation(currentConvo);
@ -145,7 +145,7 @@ export default function NewConversationMenu() {
...conversation,
isCreatedByUser: false,
error: false,
button: true
button: true,
});
return (
@ -155,7 +155,7 @@ export default function NewConversationMenu() {
<Button
id="new-conversation-menu"
variant="outline"
className={`group relative mb-[-12px] ml-0 mt-[-8px] items-center rounded-md border-0 p-1 outline-none focus:ring-0 focus:ring-offset-0 dark:data-[state=open]:bg-opacity-50 md:left-1 md:ml-[-12px] md:pl-1`}
className={'group relative mb-[-12px] ml-0 mt-[-8px] items-center rounded-md border-0 p-1 outline-none focus:ring-0 focus:ring-offset-0 dark:data-[state=open]:bg-opacity-50 md:left-1 md:ml-[-12px] md:pl-1'}
>
{icon}
<span className="max-w-0 overflow-hidden whitespace-nowrap px-0 text-slate-600 transition-all group-hover:max-w-[80px] group-hover:px-2 group-data-[state=open]:max-w-[80px] group-data-[state=open]:px-2 dark:text-slate-300">
@ -224,7 +224,7 @@ export default function NewConversationMenu() {
selection={{
selectHandler: clearAllPresets,
selectClasses: 'bg-red-600 hover:bg-red-700 dark:hover:bg-red-800 text-white',
selectText: 'Clear'
selectText: 'Clear',
}}
/>
</Dialog>
@ -234,7 +234,7 @@ export default function NewConversationMenu() {
onValueChange={onSelectPreset}
className={cn(
'overflow-y-auto overflow-x-hidden',
showEndpoints ? 'max-h-[210px]' : 'max-h-[315px]'
showEndpoints ? 'max-h-[210px]' : 'max-h-[315px]',
)}
>
{showPresets &&