Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial repo setup #2

Merged
merged 30 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8451904
add: Initial repo setup
MehulKChaudhari Nov 4, 2024
4a0a9ad
add: testing and eslint
MehulKChaudhari Nov 4, 2024
c39607f
add: workflow file
MehulKChaudhari Nov 4, 2024
a5bdfa8
fix: title of site
MehulKChaudhari Nov 4, 2024
839be08
fix: eslint config
MehulKChaudhari Nov 4, 2024
2d50efe
Update README.md
MehulKChaudhari Nov 4, 2024
733ebb8
Update README.md
MehulKChaudhari Nov 4, 2024
b8affa6
Fix: title
MehulKChaudhari Nov 4, 2024
841e091
fix: eslint
MehulKChaudhari Nov 4, 2024
b14340b
fix: CI
MehulKChaudhari Nov 4, 2024
63d001f
chore: remove frozen file flag
MehulKChaudhari Nov 4, 2024
5e6df34
fix: lint errors
MehulKChaudhari Nov 4, 2024
78c9cd0
add: volta
MehulKChaudhari Nov 4, 2024
32e9f3d
update: pnpm-lock.yaml
MehulKChaudhari Nov 4, 2024
caf2b9c
fix: pnpm version in CI
MehulKChaudhari Nov 4, 2024
b703e06
fix: formatting
MehulKChaudhari Nov 4, 2024
62151cc
chore: remove unneccesary step
MehulKChaudhari Nov 4, 2024
1183a6d
fix: format
MehulKChaudhari Nov 4, 2024
8db393a
fix: CI file
MehulKChaudhari Nov 4, 2024
a7b1cc7
Merge branch 'setup/react-ts-vite' into add-test-setup
MehulKChaudhari Nov 5, 2024
8f13fcf
fix: eslint config
MehulKChaudhari Nov 4, 2024
bd6e583
Update README.md
MehulKChaudhari Nov 4, 2024
c8c39c2
fix: title of site
MehulKChaudhari Nov 4, 2024
8e47eec
fix: lint
MehulKChaudhari Nov 5, 2024
1af6f68
Merge branch 'add-test-setup' into add-Workflow-to-run-tests-eslint-c…
MehulKChaudhari Nov 5, 2024
5ef3a12
Merge branch 'add-Workflow-to-run-tests-eslint-check' into add--volta
MehulKChaudhari Nov 5, 2024
5d3083a
Fix: title
MehulKChaudhari Nov 5, 2024
3aaf58d
Merge pull request #5 from Real-Dev-Squad/add--volta
prakashchoudhary07 Nov 6, 2024
f0cd89a
Merge pull request #4 from Real-Dev-Squad/add-Workflow-to-run-tests-e…
prakashchoudhary07 Nov 6, 2024
200948f
Merge pull request #3 from Real-Dev-Squad/add-test-setup
prakashchoudhary07 Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# website-template
A template to create all public facing sites
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/rds-logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
MehulKChaudhari marked this conversation as resolved.
Show resolved Hide resolved
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "feature-flag-frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "vitest",
"test:watch": "vitest --watch"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^9.13.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.11.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vitest": "^2.1.4"
}
}
Loading