Skip to content

Commit 07f7295

Browse files
committed
chore(config): update editorconfig and eslint configurations, remove unused prettier files, and add new prettier configuration file
1 parent 5045804 commit 07f7295

File tree

187 files changed

+1868
-6556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+1868
-6556
lines changed

.editorconfig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# EditorConfig is awesome: https://EditorConfig.org
2-
3-
# top-most EditorConfig file
41
root = true
52

63
[*]
4+
charset = utf-8
5+
end_of_line = lf
76
indent_style = space
87
indent_size = 2
9-
end_of_line = lf
10-
charset = utf-8
8+
insert_final_newline = true
119
trim_trailing_whitespace = true
12-
insert_final_newline = false
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc.cjs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,7 @@ module.exports = {
66
parser: "@typescript-eslint/parser",
77
plugins: ["react-refresh"],
88
rules: {
9-
"prettier/prettier": [
10-
"error",
11-
{
12-
printWidth: 80,
13-
tabWidth: 2,
14-
singleQuote: false,
15-
trailingComma: "all",
16-
arrowParens: "always",
17-
semi: true,
18-
endOfLine: "auto",
19-
},
20-
],
9+
"prettier/prettier": "off",
2110
"react-refresh/only-export-components": [
2211
"warn",
2312
{ allowConstantExport: true },

.prettierignore

Lines changed: 0 additions & 27 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.prettierrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: false,
5+
printWidth: 200,
6+
arrowParens: 'always',
7+
tabWidth: 2,
8+
useTabs: false,
9+
bracketSameLine: true,
10+
bracketSpacing: true,
11+
}

src/components/footer.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,7 @@ function Footer() {
5050
</div>
5151
<div className="flex gap-2">
5252
{links.map((link) => (
53-
<Button
54-
variant="link"
55-
asChild
56-
key={link.url}
57-
size="sm"
58-
className="text-xs"
59-
>
53+
<Button variant="link" asChild key={link.url} size="sm" className="text-xs">
6054
<a href={link.url} target="_blank" rel="noopener noreferrer">
6155
{link.name}
6256
</a>

src/components/header.tsx

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ import { ModeToggle } from "./mode-toggle";
1010
import { useTheme } from "./theme-provider";
1111
import { Avatar, AvatarImage } from "./ui/avatar";
1212
import { Button } from "./ui/button";
13-
import {
14-
Dialog,
15-
DialogClose,
16-
DialogContent,
17-
DialogFooter,
18-
DialogHeader,
19-
} from "./ui/dialog";
13+
import { Dialog, DialogClose, DialogContent, DialogFooter, DialogHeader } from "./ui/dialog";
2014

2115
function Header({ instanceId }: { instanceId?: string }) {
2216
const [logoutConfirmation, setLogoutConfirmation] = useState(false);
@@ -36,39 +30,18 @@ function Header({ instanceId }: { instanceId?: string }) {
3630

3731
return (
3832
<header className="flex items-center justify-between px-4 py-2">
39-
<Link
40-
to="/manager"
41-
onClick={navigateToDashboard}
42-
className="flex h-8 items-center gap-4"
43-
>
44-
<img
45-
src={
46-
theme === "dark"
47-
? "https://evolution-api.com/files/evo/evolution-logo-white.svg"
48-
: "https://evolution-api.com/files/evo/evolution-logo.svg"
49-
}
50-
alt="Logo"
51-
className="h-full"
52-
/>
33+
<Link to="/manager" onClick={navigateToDashboard} className="flex h-8 items-center gap-4">
34+
<img src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"} alt="Logo" className="h-full" />
5335
</Link>
5436
<div className="flex items-center gap-4">
5537
{instanceId && (
5638
<Avatar className="h-8 w-8">
57-
<AvatarImage
58-
src={
59-
instance?.profilePicUrl || "/assets/images/evolution-logo.png"
60-
}
61-
alt={instance?.name}
62-
/>
39+
<AvatarImage src={instance?.profilePicUrl || "/assets/images/evolution-logo.png"} alt={instance?.name} />
6340
</Avatar>
6441
)}
6542
<LanguageToggle />
6643
<ModeToggle />
67-
<Button
68-
onClick={() => setLogoutConfirmation(true)}
69-
variant="destructive"
70-
size="icon"
71-
>
44+
<Button onClick={() => setLogoutConfirmation(true)} variant="destructive" size="icon">
7245
<DoorOpen size="18" />
7346
</Button>
7447
</div>
@@ -80,11 +53,7 @@ function Header({ instanceId }: { instanceId?: string }) {
8053
<DialogHeader>Deseja realmente sair?</DialogHeader>
8154
<DialogFooter>
8255
<div className="flex items-center gap-4">
83-
<Button
84-
onClick={() => setLogoutConfirmation(false)}
85-
size="sm"
86-
variant="outline"
87-
>
56+
<Button onClick={() => setLogoutConfirmation(false)} size="sm" variant="outline">
8857
Cancelar
8958
</Button>
9059
<Button onClick={handleClose} variant="destructive">

src/components/instance-status.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ export function InstanceStatus({ status }: { status: string }) {
1111

1212
if (status === "open") return <Badge>{t("status.open")}</Badge>;
1313

14-
if (status === "connecting")
15-
return <Badge variant="warning">{t("status.connecting")}</Badge>;
14+
if (status === "connecting") return <Badge variant="warning">{t("status.connecting")}</Badge>;
1615

17-
if (status === "close" || status === "closed")
18-
return <Badge variant="destructive">{t("status.closed")}</Badge>;
16+
if (status === "close" || status === "closed") return <Badge variant="destructive">{t("status.closed")}</Badge>;
1917

2018
return <Badge variant="secondary">{status}</Badge>;
2119
}

src/components/instance-token.tsx

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,18 @@ import { copyToClipboard } from "@/utils/copy-to-clipboard";
77

88
import { Button } from "./ui/button";
99

10-
export function InstanceToken({
11-
token,
12-
className,
13-
}: {
14-
token: string;
15-
className?: string;
16-
}) {
10+
export function InstanceToken({ token, className }: { token: string; className?: string }) {
1711
const [visible, setVisible] = useState(false);
1812

1913
return (
20-
<div
21-
className={cn(
22-
"flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",
23-
className,
24-
)}
25-
>
26-
<pre className="block truncate text-xs">
27-
{visible ? token : token?.replace(/\w/g, "*")}
28-
</pre>
14+
<div className={cn("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1", className)}>
15+
<pre className="block truncate text-xs">{visible ? token : token?.replace(/\w/g, "*")}</pre>
2916
<Button
3017
variant="ghost"
3118
size="icon"
3219
onClick={() => {
3320
copyToClipboard(token);
34-
}}
35-
>
21+
}}>
3622
<Copy size="15" />
3723
</Button>
3824

@@ -41,8 +27,7 @@ export function InstanceToken({
4127
size="icon"
4228
onClick={() => {
4329
setVisible((old) => !old);
44-
}}
45-
>
30+
}}>
4631
{visible ? <EyeOff size="15" /> : <Eye size="15" />}
4732
</Button>
4833
</div>

src/components/language-toggle.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ import { Languages } from "lucide-react";
22
import { useTranslation } from "react-i18next";
33

44
import { Button } from "@/components/ui/button";
5-
import {
6-
DropdownMenu,
7-
DropdownMenuContent,
8-
DropdownMenuItem,
9-
DropdownMenuTrigger,
10-
} from "@/components/ui/dropdown-menu";
5+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
116

127
export function LanguageToggle() {
138
const { t, i18n } = useTranslation();
@@ -27,28 +22,16 @@ export function LanguageToggle() {
2722
</Button>
2823
</DropdownMenuTrigger>
2924
<DropdownMenuContent align="end">
30-
<DropdownMenuItem
31-
className={i18n.language === "pt-BR" ? "font-bold" : ""}
32-
onClick={() => changeLanguage("pt-BR")}
33-
>
25+
<DropdownMenuItem className={i18n.language === "pt-BR" ? "font-bold" : ""} onClick={() => changeLanguage("pt-BR")}>
3426
{t("header.language.portuguese")}
3527
</DropdownMenuItem>
36-
<DropdownMenuItem
37-
className={i18n.language === "en-US" ? "font-bold" : ""}
38-
onClick={() => changeLanguage("en-US")}
39-
>
28+
<DropdownMenuItem className={i18n.language === "en-US" ? "font-bold" : ""} onClick={() => changeLanguage("en-US")}>
4029
{t("header.language.english")}
4130
</DropdownMenuItem>
42-
<DropdownMenuItem
43-
className={i18n.language === "es-ES" ? "font-bold" : ""}
44-
onClick={() => changeLanguage("es-ES")}
45-
>
31+
<DropdownMenuItem className={i18n.language === "es-ES" ? "font-bold" : ""} onClick={() => changeLanguage("es-ES")}>
4632
{t("header.language.spanish")}
4733
</DropdownMenuItem>
48-
<DropdownMenuItem
49-
className={i18n.language === "fr-FR" ? "font-bold" : ""}
50-
onClick={() => changeLanguage("fr-FR")}
51-
>
34+
<DropdownMenuItem className={i18n.language === "fr-FR" ? "font-bold" : ""} onClick={() => changeLanguage("fr-FR")}>
5235
{t("header.language.french")}
5336
</DropdownMenuItem>
5437
</DropdownMenuContent>

0 commit comments

Comments
 (0)