-
Notifications
You must be signed in to change notification settings - Fork 65
Modernize React TypeScript template #9
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
Open
scobo
wants to merge
21
commits into
phaserjs:main
Choose a base branch
from
scobo:modernize-template
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,308
−4,287
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ded2ed7
Modernize React TypeScript template
scobo cbd170c
Fix glob
scobo b1640e3
Upgrade some packages
scobo 30ac5e4
Upgrade to Vite v8
scobo 6cc54cd
Upgrade some packages
scobo cc2f29a
Upgrade some dependencies
scobo 3a4b144
Upgrade some packages
scobo ff7c5e3
Separate React from bundle
scobo 4205f61
Optimize manual chunks in prod build
scobo a3685e8
Add eslint-plugin-n
scobo 8d02343
Use full @eslint/js config
scobo 35c9bce
Switch from ESLint to Oxlint
scobo b2d45c0
Add ESLint for eslint/config only
scobo a733745
Remove ESLint dependency
scobo 78edef2
Add ESLint just to satisfy peer deps
scobo b6a21c8
Upgrade some packages
scobo cb461a8
Upgrade some packages
scobo aeeea0b
Upgrade some packages
scobo 4de8afd
Revert "Switch from ESLint to Oxlint"
scobo 033721a
Upgrade some packages
scobo c23c0f5
Feedback, upgrade some packages
scobo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| lint-staged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| pnpm run lint | ||
| pnpm run stylelint | ||
| pnpm run format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| save-exact=true | ||
| save-prefix="" | ||
| legacy-peer-deps=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package.json | ||
| package-lock.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| yarn-lock.json | ||
| phaser.js | ||
| *.css.d.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist | ||
| dist-ssr |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| import js from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import importPlugin from "eslint-plugin-import"; | ||
| import nodePlugin from "eslint-plugin-n"; | ||
| import pluginReact from "eslint-plugin-react"; | ||
| import reactCompiler from "eslint-plugin-react-compiler"; | ||
| import reactHooks from "eslint-plugin-react-hooks"; | ||
| import reactRefresh from "eslint-plugin-react-refresh"; | ||
| import simpleImportSort from "eslint-plugin-simple-import-sort"; | ||
| import globals from "globals"; | ||
| import tseslint from "typescript-eslint"; | ||
|
|
||
| export default defineConfig([ | ||
| tseslint.configs.strictTypeChecked, | ||
| tseslint.configs.stylisticTypeChecked, | ||
| { | ||
| ...pluginReact.configs.flat.recommended, | ||
| settings: { react: { version: "19" } }, | ||
| }, | ||
| pluginReact.configs.flat["jsx-runtime"], | ||
| reactCompiler.configs.recommended, | ||
| reactHooks.configs.flat["recommended-latest"], | ||
| reactRefresh.configs.recommended, | ||
| js.configs.recommended, | ||
| { | ||
| ignores: ["dist"], | ||
| }, | ||
| { | ||
| files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], | ||
| plugins: { | ||
| js, | ||
| import: importPlugin, | ||
| "simple-import-sort": simpleImportSort, | ||
| }, | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2024, | ||
| Phaser: "readonly", | ||
| }, | ||
| parserOptions: { | ||
| projectService: true, | ||
| }, | ||
| }, | ||
| rules: { | ||
| "no-undef": "off", // Defer to TypeScript | ||
| "no-unused-vars": "off", // Defer to @typescript-eslint/no-unused-vars | ||
|
|
||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| args: "all", | ||
| argsIgnorePattern: "^_", | ||
| caughtErrors: "all", | ||
| caughtErrorsIgnorePattern: "^_", | ||
| destructuredArrayIgnorePattern: "^_", | ||
| varsIgnorePattern: "^_", | ||
| ignoreRestSiblings: true, | ||
| }, | ||
| ], | ||
| "@typescript-eslint/restrict-template-expressions": [ | ||
| "error", | ||
| { | ||
| allowNumber: true, | ||
| }, | ||
| ], | ||
|
|
||
| "react-refresh/only-export-components": [ | ||
| "warn", | ||
| { allowConstantExport: true }, | ||
| ], | ||
|
|
||
| "simple-import-sort/imports": [ | ||
| "error", | ||
| { | ||
| groups: [ | ||
| // Type imports. | ||
| ["\\w\\u0000$"], | ||
| // Side effect imports. | ||
| ["^\\u0000"], | ||
| // Node.js builtins prefixed with `node:`. | ||
| ["^node:"], | ||
| // Packages. | ||
| // Things that start with a letter (or digit or underscore), or `@` followed by a letter. | ||
| ["^@?\\w"], | ||
| // Absolute imports and other imports such as Vue-style `@/foo`. | ||
| // Anything not matched in another group. | ||
| ["^"], | ||
| // Things that start with `#` followed by a letter. | ||
| ["^#\\w"], | ||
| // Relative imports. | ||
| // Anything that starts with a dot. | ||
| ["^\\."], | ||
| ], | ||
| }, | ||
| ], | ||
| "simple-import-sort/exports": "error", | ||
| "import/first": "error", | ||
| "import/newline-after-import": "error", | ||
| "import/no-duplicates": "error", | ||
| }, | ||
| }, | ||
| { | ||
| ...nodePlugin.configs["flat/recommended-module"], | ||
| files: ["**/scripts/*.{js,mjs,cjs,ts,mts,cts}"], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.node, | ||
| ...globals.es2024, | ||
| }, | ||
| parserOptions: { | ||
| projectService: true, | ||
| }, | ||
| }, | ||
| }, | ||
| ]); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,19 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/png" href="/favicon.png" /> | ||
| <html lang="en" dir="ltr"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <link rel="stylesheet" href="/style.css"> | ||
| <meta name="robots" content="noindex" /> | ||
| <title>Phaser React Template</title> | ||
| </head> | ||
| <link rel="stylesheet" href="/style.css" /> | ||
| <meta name="description" content="" /> | ||
|
|
||
| <body> | ||
| <link rel="icon" type="image/png" href="/favicon.png" sizes="16x16" /> | ||
| <link rel="shortcut icon" href="/favicon.png" /> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
|
|
||
| </body> | ||
| </body> | ||
| </html> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.