Skip to content

Commit e62c082

Browse files
committed
Switch from create-react-app to Vite
CRA is deprecated and unmaintained for months Update tests to vitest so that npm test works (even though we don't use it) Switch eslint setup to support vite
1 parent d3fecc0 commit e62c082

File tree

16 files changed

+10443
-26780
lines changed

16 files changed

+10443
-26780
lines changed

josh-ui/eslint.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import js from '@eslint/js';
2+
import tseslint from '@typescript-eslint/eslint-plugin';
3+
import tsParser from '@typescript-eslint/parser';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import reactHooks from 'eslint-plugin-react-hooks';
6+
7+
const reactRecommended = {
8+
...reactPlugin.configs.flat.recommended,
9+
files: ['**/*.{jsx,tsx}'],
10+
settings: {
11+
react: {
12+
version: 'detect',
13+
},
14+
},
15+
};
16+
17+
const reactHooksRecommended = {
18+
...reactHooks.configs.flat.recommended,
19+
files: ['**/*.{jsx,tsx}'],
20+
};
21+
22+
export default [
23+
js.configs.recommended,
24+
...tseslint.configs['flat/recommended'],
25+
{
26+
files: ['**/*.{ts,tsx,js,jsx}'],
27+
languageOptions: {
28+
parser: tsParser,
29+
parserOptions: {
30+
ecmaVersion: 'latest',
31+
sourceType: 'module',
32+
ecmaFeatures: {
33+
jsx: true,
34+
},
35+
},
36+
},
37+
},
38+
reactRecommended,
39+
reactHooksRecommended,
40+
];
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,10 @@
1212
manifest.json provides metadata used when your web app is installed on a
1313
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1414
-->
15-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16-
<!--
17-
Notice the use of %PUBLIC_URL% in the tags above.
18-
It will be replaced with the URL of the `public` folder during the build.
19-
Only files inside the `public` folder can be referenced from the HTML.
20-
21-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22-
work correctly both with client-side routing and a non-root public URL.
23-
Learn how to configure a non-root public URL by running `npm run build`.
24-
-->
25-
<link rel="icon" type="image/x-icon" href="%PUBLIC_URL%/favicon.ico">
26-
<title>React App</title>
15+
<link rel="manifest" href="/manifest.json" />
16+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
17+
<title>Josh</title>
18+
<script type="module" src="/src/main.tsx"></script>
2719
</head>
2820
<body>
2921
<noscript>You need to enable JavaScript to run this app.</noscript>

0 commit comments

Comments
 (0)