Skip to content

Commit aa0a475

Browse files
Initial commit
0 parents  commit aa0a475

39 files changed

+4300
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
root = true
3+
4+
# Default for all files
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
# Specific overrides for common web project files
14+
[*.{js,ts,tsx,jsx,scss,css,html,json,md}]
15+
indent_style = space
16+
indent_size = 2

.eslint.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
import prettier from "eslint-config-prettier";
7+
8+
export default tseslint.config(
9+
{ ignores: ["dist", "node_modules"] },
10+
{
11+
files: ["**/*.{ts,tsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
sourceType: "module",
15+
globals: globals.browser,
16+
},
17+
plugins: {
18+
"react-hooks": reactHooks,
19+
"react-refresh": reactRefresh,
20+
},
21+
rules: {
22+
...reactHooks.configs.recommended.rules,
23+
"react-refresh/only-export-components": [
24+
"warn",
25+
{ allowConstantExport: true },
26+
],
27+
},
28+
extends: [
29+
js.configs.recommended,
30+
...tseslint.configs.recommended,
31+
prettier, // 👈 Disables ESLint formatting rules that conflict with Prettier
32+
],
33+
}
34+
);

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
pnpm-debug.log*
7+
8+
# Dependency directory
9+
node_modules/
10+
11+
# Build output
12+
dist/
13+
build/
14+
out/
15+
16+
# TypeScript
17+
*.tsbuildinfo
18+
19+
# Vite
20+
.vite/
21+
22+
# Linting
23+
.eslintcache
24+
.stylelintcache
25+
26+
# Environment variables
27+
.env
28+
.env.*
29+
30+
# Editor / OS
31+
.vscode/
32+
.idea/
33+
.DS_Store
34+
*.swp
35+
*.swo

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"printWidth": 100,
6+
"trailingComma": "all"
7+
}

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# React + TypeScript + Vite
2+
3+
# vite-react-ts-starter
4+
5+
# Vite React Typescript Starter Template
6+
7+
Vite -> React -> TypeScript SWC
8+
9+
This is a starter template for using Vite -> React -> TypeScript. Scaffolded from Vite with TypeScript SWC. This includes the following additions:
10+
11+
1.) React Router with page and navlink setup
12+
2.) Typescript types for react router dom and anything else?
13+
3.) SASS
14+
4.) CSS modules for scoped classes
15+
5.) css reset
16+
6.) Dark / light theme
17+
7.) Example component setup
18+
8.) ESlint / Prettier config setup
19+
20+
Nothing super opinionated just modern best practices.

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta
7+
name="description"
8+
content="A modern Vite + React + TypeScript starter template with SCSS Modules and best practices."
9+
/>
10+
<meta name="theme-color" content="#329ab4" />
11+
<title>Vite + React + TypeScript Starter Template</title>
12+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
13+
<!-- Fonts (Optional) -->
14+
<link rel="preconnect" href="https://fonts.googleapis.com" />
15+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
16+
<link
17+
href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600&display=swap"
18+
rel="stylesheet"
19+
/>
20+
</head>
21+
<body>
22+
<div id="root"></div>
23+
<script type="module" src="/src/main.tsx"></script>
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)