Skip to content

Commit d3544ff

Browse files
author
Eric Avila
committed
update: added readme and other stuffs
1 parent ec37e87 commit d3544ff

13 files changed

+130
-15
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
node: true
1818
},
1919
files: [
20-
'.eslintrc.{js,cjs}'
20+
'.eslintrc.{js,cjs,jsx,mjs,ts,tsx}',
2121
],
2222
parserOptions: {
2323
sourceType: 'script'

.prettierrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{
2-
"userTabs": true,
3-
"semi": false,
4-
"singleQuote": true,
5-
"jsxSingleQuote": true,
6-
"bracketLine": true,
7-
"arrowParens": "avoid",
8-
"endOfLine": "lf",
1+
{
2+
"userTabs": true,
3+
"semi": false,
4+
"singleQuote": true,
5+
"jsxSingleQuote": true,
6+
"bracketLine": true,
7+
"arrowParens": "avoid",
8+
"endOfLine": "lf"
99
}

README.md

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,115 @@
1-
# boilerplate-vite-reactjs
2-
Basic boilerplate: ReactJS,ESLINT+PRETTIER,ALIAS PATH,PNPM,BASIC STRUCTURE PACK
1+
# boilerplate-vite-reactjs
2+
3+
![alt](./readme/review.png)
4+
5+
## Requeriments
6+
7+
- **ESLINT Plugin**
8+
9+
![alt](./readme/eslint.png)
10+
11+
- **PRETTIER Plugin**
12+
13+
![alt](./readme/prettier.png)
14+
15+
- **PNPM Package manager**
16+
17+
![alt](./readme/pnpm.png)
18+
19+
- **Image Preview** (Optional)
20+
21+
![alt](./readme/imagepreview.png)
22+
23+
This plugin is a lifesaver! It gives you a sweet preview of your image files, no matter the extension (svg, png, jpg, you name it). You'll find it on the left side, right next to the line number. Just hover your cursor over the path, and voila! You'll see the image pop up, even within the component.
24+
25+
**Example**
26+
![alt](./readme/previewexample.png)
27+
28+
## Description
29+
30+
This project is created for ReactJS using the PNPM Package Manager. It comes with basic ESLint and Prettier configurations, as well as the use of relative paths based on the project's path structure. Essentially, it's a boilerplate that helps you kickstart your projects quickly and easily.
31+
32+
I hope this less formal version meets your requirements. If you need any further modifications or have any other requests, please let me know.
33+
34+
## Configuration description
35+
36+
### vite.config.js
37+
38+
Check out the vite.config.js file! That's where you'll find all the routes with their fancy aliases for the project. If you want to add a new route, simply follow the same writing style as shown in the line below.
39+
40+
```js
41+
import { fileURLToPath, URL } from "url";
42+
import { defineConfig } from "vite";
43+
import vue from "@vitejs/plugin-react";
44+
45+
// https://vitejs.dev/config/
46+
export default defineConfig({
47+
plugins: [vue()],
48+
resolve: {
49+
alias: [
50+
{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) },
51+
{ find: '@assets', replacement: fileURLToPath(new URL('./src/assets', import.meta.url)) },
52+
{ find: '@components', replacement: fileURLToPath(new URL('./src/components', import.meta.url)) },
53+
{ find: '@config', replacement: fileURLToPath(new URL('./src/config', import.meta.url)) },
54+
{ find: '@pages', replacement: fileURLToPath(new URL('./src/pages', import.meta.url)) },
55+
{ find: '@router', replacement: fileURLToPath(new URL('./src/router', import.meta.url)) },
56+
{ find: '@styles', replacement: fileURLToPath(new URL('./src/styles', import.meta.url)) },
57+
{ find: '@utils', replacement: fileURLToPath(new URL('./src/utils', import.meta.url)) },
58+
],
59+
},
60+
});
61+
```
62+
63+
#### jsconfig.json
64+
65+
```js
66+
{
67+
"compilerOptions": {
68+
"baseUrl": ".",
69+
"paths": {
70+
"@/*": ["/src/*"],
71+
"@assets/*": ["/src/assets/*"],
72+
"@components/*": ["/src/components/*"],
73+
"@config/*": ["/src/config/*"],
74+
"@pages/*": ["/src/pages/*"],
75+
"@router/*": ["/src/router/*"],
76+
"@styles/*": ["/src/styles/*"],
77+
"@utils/*": ["/src/utils/*"],
78+
}
79+
}
80+
}
81+
```
82+
83+
> ⚡VSCODE will automatically detect the routes and suggest them in autocomplete.
84+
85+
![alt](./readme/autocomplete.png)
86+
87+
---
88+
### .prettierrc
89+
90+
PRETTIER is the handy tool you need to keep your code in check! It's like having a code format enforcer that ensures everything looks clean and organized. When you collaborate with others on the same project, thanks to PRETTIER's rules, there won't be a jumbled mess of code styles.
91+
92+
Need some extra rules? Check out this link: [Rules Prettier]([/guides/content/editing-an-existing-page](https://prettier.io/docs/en/options.html)). Although the configurations already in the file should cover your needs, it's always good to have more choices based on personal preference and team organization. But honestly, what you have here is more than sufficient to get things rolling.
93+
94+
95+
```js
96+
{
97+
"userTabs": true,
98+
"semi": false,
99+
"singleQuote": true,
100+
"jsxSingleQuote": true,
101+
"bracketLine": true,
102+
"arrowParens": "avoid",
103+
"endOfLine": "lf"
104+
}
105+
```
106+
107+
---
108+
---
109+
110+
> If this repository has been helpful to you, please show your support by giving it a star. It would mean the world to me, and I'll be extremely grateful. Thank you!
111+
112+
113+
Make sure to swing by my Personal Blog! You never know what gems you'll discover that could be of value to you or your buddies.
114+
115+
[<ode <raft avila Blog](https://codecraftavila.super.site/)

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,5 @@
2828
"eslint-plugin-react-refresh": "^0.4.1",
2929
"prettier": "^3.0.0",
3030
"vite": "^4.4.0"
31-
},
32-
"imports": {
33-
"@": "./src",
34-
"@assets": "./src/assets"
3531
}
3632
}

readme/autocomplete.png

54.2 KB
Loading

readme/cca.svg

Lines changed: 6 additions & 0 deletions
Loading

readme/eslint.png

21.2 KB
Loading

readme/imagepreview.png

14.3 KB
Loading

readme/pnpm.png

12.2 KB
Loading

readme/prettier.png

21.3 KB
Loading

readme/previewexample.png

35.6 KB
Loading

readme/review.png

56 KB
Loading

readme/structure.png

22.1 KB
Loading

0 commit comments

Comments
 (0)