-
Notifications
You must be signed in to change notification settings - Fork 61
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
20
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.
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
178c35a
Modernize React TypeScript template
scobo 9a8b28d
Fix glob
scobo 479b9e7
Upgrade some packages
scobo 7e85415
Upgrade to Vite v8
scobo 4735fdd
Upgrade some packages
scobo 30bfaef
Upgrade some dependencies
scobo 512e3bf
Upgrade some packages
scobo defe744
Separate React from bundle
scobo 8558436
Optimize manual chunks in prod build
scobo 7a413be
Add eslint-plugin-n
scobo b963064
Use full @eslint/js config
scobo de6416a
Switch from ESLint to Oxlint
scobo 9f13e70
Add ESLint for eslint/config only
scobo 8858662
Remove ESLint dependency
scobo 6c2410f
Add ESLint just to satisfy peer deps
scobo 36447c6
Upgrade some packages
scobo 554a1d2
Upgrade some packages
scobo c9b4687
Upgrade some packages
scobo 6028c9d
Revert "Switch from ESLint to Oxlint"
scobo 3bf2d57
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.14.0 |
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 |
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 @@ | ||
| { | ||
| "extends": "stylelint-config-standard" | ||
| } |
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,114 @@ | ||
| import js from "@eslint/js"; | ||
| import { defineConfig } from "eslint/config"; | ||
| import importPlugin from "eslint-plugin-import"; | ||
| 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, | ||
| { | ||
| ignores: ["dist"], | ||
| }, | ||
| { | ||
| files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], | ||
| plugins: { | ||
| js, | ||
| import: importPlugin, | ||
| "simple-import-sort": simpleImportSort, | ||
| }, | ||
| extends: ["js/recommended"], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2020, | ||
| 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", | ||
| }, | ||
| }, | ||
| { | ||
| 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.