Skip to content

Commit 26ab1b5

Browse files
style: format code with StandardJS
This commit fixes the style issues introduced in d549a61 according to the output from StandardJS. Details: None
1 parent d549a61 commit 26ab1b5

24 files changed

+1125
-1177
lines changed

doc/eslint.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export default [
1414
parserOptions: {
1515
ecmaVersion: 'latest',
1616
ecmaFeatures: { jsx: true },
17-
sourceType: 'module',
18-
},
17+
sourceType: 'module'
18+
}
1919
},
2020
settings: { react: { version: '18.3' } },
2121
plugins: {
2222
react,
2323
'react-hooks': reactHooks,
24-
'react-refresh': reactRefresh,
24+
'react-refresh': reactRefresh
2525
},
2626
rules: {
2727
...js.configs.recommended.rules,
@@ -31,8 +31,8 @@ export default [
3131
'react/jsx-no-target-blank': 'off',
3232
'react-refresh/only-export-components': [
3333
'warn',
34-
{ allowConstantExport: true },
35-
],
36-
},
37-
},
34+
{ allowConstantExport: true }
35+
]
36+
}
37+
}
3838
]

doc/postcss.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
plugins: {
33
tailwindcss: {},
4-
autoprefixer: {},
5-
},
4+
autoprefixer: {}
5+
}
66
}

doc/src/components/features.jsx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
1-
import Typography from "./general/typography";
1+
import Typography from './general/typography'
22

33
const Features = () => {
44
return (
5-
<div className="p-6 bg-gray-900 shadow-lg rounded-lg md:p-8 lg:p-10">
5+
<div className='p-6 bg-gray-900 shadow-lg rounded-lg md:p-8 lg:p-10'>
66
<Typography
7-
variant="h4"
8-
className="mb-6 text-gray-100 text-center md:text-left font-bold"
7+
variant='h4'
8+
className='mb-6 text-gray-100 text-center md:text-left font-bold'
99
>
1010
Key Features of Hasty Server
1111
</Typography>
1212

13-
<ul className="list-disc list-inside mb-6 text-gray-300 leading-relaxed space-y-6">
14-
<li className="mb-4">
15-
<Typography variant="h5" className="text-gray-100 font-semibold">
13+
<ul className='list-disc list-inside mb-6 text-gray-300 leading-relaxed space-y-6'>
14+
<li className='mb-4'>
15+
<Typography variant='h5' className='text-gray-100 font-semibold'>
1616
High Performance
1717
</Typography>
18-
<Typography variant="body1" className="text-gray-300">
18+
<Typography variant='body1' className='text-gray-300'>
1919
Hasty Server is designed for speed. It’s built using low-level
2020
networking APIs, ensuring minimal overhead and high concurrency.
2121
This makes it capable of handling thousands of requests per second
2222
with ease, perfect for high-traffic applications.
2323
</Typography>
2424
</li>
2525

26-
<li className="mb-4">
27-
<Typography variant="h5" className="text-gray-100 font-semibold">
26+
<li className='mb-4'>
27+
<Typography variant='h5' className='text-gray-100 font-semibold'>
2828
Developer Friendly
2929
</Typography>
30-
<Typography variant="body1" className="text-gray-300">
30+
<Typography variant='body1' className='text-gray-300'>
3131
It offers a simple and intuitive API, inspired by Express.js.
3232
Whether you’re a beginner or an experienced developer, the clear
3333
structure and easy-to-use syntax allow you to build applications
3434
faster and with fewer bugs.
3535
</Typography>
3636
</li>
3737

38-
<li className="mb-4">
39-
<Typography variant="h5" className="text-gray-100 font-semibold">
38+
<li className='mb-4'>
39+
<Typography variant='h5' className='text-gray-100 font-semibold'>
4040
Built-in Security
4141
</Typography>
42-
<Typography variant="body1" className="text-gray-300">
42+
<Typography variant='body1' className='text-gray-300'>
4343
Security is a top priority. Hasty Server includes built-in
4444
protections against common vulnerabilities such as XSS (Cross-Site
4545
Scripting), CSRF (Cross-Site Request Forgery), and SQL injection,
4646
helping you create secure applications without extra effort.
4747
</Typography>
4848
</li>
4949

50-
<li className="mb-4">
51-
<Typography variant="h5" className="text-gray-100 font-semibold">
50+
<li className='mb-4'>
51+
<Typography variant='h5' className='text-gray-100 font-semibold'>
5252
Extensible Architecture
5353
</Typography>
54-
<Typography variant="body1" className="text-gray-300">
54+
<Typography variant='body1' className='text-gray-300'>
5555
With its middleware-based architecture, Hasty Server allows you to
5656
add custom plugins and middlewares. You can extend its functionality
5757
by adding your own handlers or integrating third-party libraries
5858
with ease.
5959
</Typography>
6060
</li>
6161

62-
<li className="mb-4">
63-
<Typography variant="h5" className="text-gray-100 font-semibold">
62+
<li className='mb-4'>
63+
<Typography variant='h5' className='text-gray-100 font-semibold'>
6464
Lightweight & Minimal
6565
</Typography>
66-
<Typography variant="body1" className="text-gray-300">
66+
<Typography variant='body1' className='text-gray-300'>
6767
Despite its powerful features, Hasty Server remains lightweight and
6868
efficient. It minimizes resource consumption, making it ideal for
6969
resource-constrained environments such as microservices or
7070
serverless applications.
7171
</Typography>
7272
</li>
7373

74-
<li className="mb-4">
75-
<Typography variant="h5" className="text-gray-100 font-semibold">
74+
<li className='mb-4'>
75+
<Typography variant='h5' className='text-gray-100 font-semibold'>
7676
Scalable
7777
</Typography>
78-
<Typography variant="body1" className="text-gray-300">
78+
<Typography variant='body1' className='text-gray-300'>
7979
Whether you are building a small personal project or a large-scale
8080
enterprise application, Hasty Server scales effortlessly. Its
8181
modular design lets you efficiently manage growing traffic and
8282
users.
8383
</Typography>
8484
</li>
8585

86-
<li className="mb-4">
87-
<Typography variant="h5" className="text-gray-100 font-semibold">
86+
<li className='mb-4'>
87+
<Typography variant='h5' className='text-gray-100 font-semibold'>
8888
Flexible Routing
8989
</Typography>
90-
<Typography variant="body1" className="text-gray-300">
90+
<Typography variant='body1' className='text-gray-300'>
9191
Hasty Server provides a flexible routing system, allowing you to
9292
define routes for different HTTP methods (GET, POST, PUT, DELETE,
9393
etc.). You can also create dynamic routes with parameters for even
@@ -96,7 +96,7 @@ const Features = () => {
9696
</li>
9797
</ul>
9898
</div>
99-
);
100-
};
99+
)
100+
}
101101

102-
export default Features;
102+
export default Features
Lines changed: 56 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
import * as React from "react";
2-
import { cva } from "class-variance-authority";
3-
import PropTypes from "prop-types";
4-
import { mergeClasses } from "../../lib/utils";
1+
import * as React from 'react'
2+
import { cva } from 'class-variance-authority'
3+
import PropTypes from 'prop-types'
4+
import { mergeClasses } from '../../lib/utils'
55

6-
const typographyVariants = cva(" text-normal", {
6+
const typographyVariants = cva(' text-normal', {
77
variants: {
88
variant: {
9-
h1: "text-4xl font-semibold md:font-bold md:text-5xl md:tracking-[-0.02em] lg:text-6xl lg:leading-[72px] ",
10-
h2: "text-lg md:text-4xl font-semibold tracking-[-0.02em] ",
11-
h3: "text-2xl md:text-3xl font-semibold tracking-[-0.02em] ",
12-
h4: "text-xl md:text-2xl font-semibold tracking-[-0.02em] ",
13-
h5: "text-lg md:text-xl font-semibold tracking-[-0.02em] ",
14-
h6: "text-base md:text-lg font-semibold tracking-[-0.02em] ",
15-
subtitle: "text-lg md:text-xl",
16-
body1: "text-base md:text-lg",
17-
body2: "text-base",
18-
body3: "text-sm",
19-
caption: "text-sm ",
20-
overline: "text-xs uppercase",
21-
},
9+
h1: 'text-4xl font-semibold md:font-bold md:text-5xl md:tracking-[-0.02em] lg:text-6xl lg:leading-[72px] ',
10+
h2: 'text-lg md:text-4xl font-semibold tracking-[-0.02em] ',
11+
h3: 'text-2xl md:text-3xl font-semibold tracking-[-0.02em] ',
12+
h4: 'text-xl md:text-2xl font-semibold tracking-[-0.02em] ',
13+
h5: 'text-lg md:text-xl font-semibold tracking-[-0.02em] ',
14+
h6: 'text-base md:text-lg font-semibold tracking-[-0.02em] ',
15+
subtitle: 'text-lg md:text-xl',
16+
body1: 'text-base md:text-lg',
17+
body2: 'text-base',
18+
body3: 'text-sm',
19+
caption: 'text-sm ',
20+
overline: 'text-xs uppercase'
21+
}
2222
},
2323
defaultVariants: {
24-
variant: "body2",
25-
},
26-
});
24+
variant: 'body2'
25+
}
26+
})
2727

28-
let elementMapping = {
29-
h1: "h1",
30-
h2: "h2",
31-
h3: "h3",
32-
h4: "h4",
33-
h5: "h5",
34-
h6: "h6",
35-
subtitle: "p",
36-
body1: "p",
37-
body2: "p",
38-
body3: "p",
39-
caption: "span",
40-
overline: "span",
41-
};
28+
const elementMapping = {
29+
h1: 'h1',
30+
h2: 'h2',
31+
h3: 'h3',
32+
h4: 'h4',
33+
h5: 'h5',
34+
h6: 'h6',
35+
subtitle: 'p',
36+
body1: 'p',
37+
body2: 'p',
38+
body3: 'p',
39+
caption: 'span',
40+
overline: 'span'
41+
}
4242

4343
const Typography = React.forwardRef(
44-
({ component, className = "", variant, children, ...props }, ref) => {
45-
const Comp = component
46-
? component
47-
: variant
44+
({ component, className = '', variant, children, ...props }, ref) => {
45+
const Comp = component || (variant
4846
? elementMapping[variant]
49-
: "p";
47+
: 'p')
5048

5149
return (
5250
<Comp
@@ -56,30 +54,30 @@ const Typography = React.forwardRef(
5654
>
5755
{children}
5856
</Comp>
59-
);
57+
)
6058
}
61-
);
59+
)
6260

63-
Typography.displayName = "Typography";
61+
Typography.displayName = 'Typography'
6462

6563
Typography.propTypes = {
6664
component: PropTypes.elementType,
6765
className: PropTypes.string,
6866
variant: PropTypes.oneOf([
69-
"h1",
70-
"h2",
71-
"h3",
72-
"h4",
73-
"h5",
74-
"h6",
75-
"subtitle",
76-
"body1",
77-
"body2",
78-
"body3",
79-
"caption",
80-
"overline",
67+
'h1',
68+
'h2',
69+
'h3',
70+
'h4',
71+
'h5',
72+
'h6',
73+
'subtitle',
74+
'body1',
75+
'body2',
76+
'body3',
77+
'caption',
78+
'overline'
8179
]),
82-
children: PropTypes.node,
83-
};
80+
children: PropTypes.node
81+
}
8482

85-
export default Typography;
83+
export default Typography

doc/src/components/header.jsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
import Typography from "./general/typography";
1+
import Typography from './general/typography'
22

33
const Header = () => {
44
return (
5-
<header className="bg-black text-white p-4 flex justify-between items-center md:px-20">
6-
<div className="flex items-center">
5+
<header className='bg-black text-white p-4 flex justify-between items-center md:px-20'>
6+
<div className='flex items-center'>
77
<img
8-
src="../../logo.png"
9-
alt="Hasty Server Logo"
10-
className="w-20"
8+
src='../../logo.png'
9+
alt='Hasty Server Logo'
10+
className='w-20'
1111
/>
1212
</div>
1313
<nav>
14-
<ul className="flex space-x-4">
15-
<li>
14+
<ul className='flex space-x-4'>
15+
<li>
1616
<a
17-
href="https://github.com/IntegerAlex/hasty-server"
18-
className="text-[#f3ce1f] hover:text-[#a89223]"
19-
target="_blank"
20-
rel="noopener noreferrer"
17+
href='https://github.com/IntegerAlex/hasty-server'
18+
className='text-[#f3ce1f] hover:text-[#a89223]'
19+
target='_blank'
20+
rel='noopener noreferrer'
2121
>
22-
<Typography variant="body1">view on github</Typography>
22+
<Typography variant='body1'>view on github</Typography>
2323
</a>
2424
</li>
2525
<li>
2626
<a
27-
href="https://www.npmjs.com/package/hasty-server"
28-
className="text-[#f3ce1f] hover:text-[#a89223]"
29-
target="_blank"
30-
rel="noopener noreferrer"
27+
href='https://www.npmjs.com/package/hasty-server'
28+
className='text-[#f3ce1f] hover:text-[#a89223]'
29+
target='_blank'
30+
rel='noopener noreferrer'
3131
>
32-
<Typography variant="body1">Package Download</Typography>
32+
<Typography variant='body1'>Package Download</Typography>
3333
</a>
3434
</li>
3535
</ul>
3636
</nav>
3737
</header>
38-
);
39-
};
38+
)
39+
}
4040

41-
export default Header;
41+
export default Header

0 commit comments

Comments
 (0)