Skip to content

Commit 9132674

Browse files
committed
chore: update templates
1 parent 990e4d6 commit 9132674

13 files changed

+639
-404
lines changed

.eslintrc.cjs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
// This is the configuration file for ESLint, the TypeScript linter:
2-
// https://eslint.org/docs/user-guide/configuring
3-
module.exports = {
2+
// https://eslint.org/docs/latest/use/configure/
3+
4+
/** @type {import("eslint").Linter.Config} */
5+
const config = {
46
extends: [
57
// The linter base is the shared IsaacScript config:
68
// https://github.com/IsaacScript/isaacscript/blob/main/packages/eslint-config-isaacscript/configs/base.js
79
"eslint-config-isaacscript/base",
810
],
911

12+
// Don't bother linting the compiled output.
13+
// @template-ignore-next-line
14+
ignorePatterns: ["**/dist/**", "**/lib/**", "**/version.js"],
15+
1016
parserOptions: {
1117
// ESLint needs to know about the project's TypeScript settings in order for TypeScript-specific
1218
// things to lint correctly. We do not point this at "./tsconfig.json" because certain files
1319
// (such at this file) should be linted but not included in the actual project output.
14-
project: ["./tsconfig.eslint.json"],
20+
project: "./tsconfig.eslint.json",
1521
},
1622

17-
ignorePatterns: ["**/dist/**", "**/lib/**", "**/version.js"],
18-
1923
rules: {
24+
// Insert changed or disabled rules here, if necessary.
25+
// @template-customization-start
26+
2027
/**
2128
* Documentation:
2229
* https://eslint.org/docs/latest/rules/func-style
@@ -115,5 +122,9 @@ module.exports = {
115122
* dependencies being up to date).
116123
*/
117124
"unicorn/prefer-top-level-await": "off",
125+
126+
// @template-customization-end
118127
},
119128
};
129+
130+
module.exports = config;

.prettierignore

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
# Keldon files
2-
keldon
1+
# Compiled output
2+
dist
33

4-
# Special Golang files
5-
go.mod
6-
7-
# Images
8-
*.svg
4+
# Package manager lock files
5+
package-lock.json
6+
yarn.lock
7+
pnpm-lock.yaml
98

109
# Minified files
1110
*.min.js
1211
*.min.css
1312

13+
# @template-customization-start
14+
15+
# Images
16+
*.svg
17+
18+
# Special Golang files
19+
go.mod
20+
1421
# Temporary files
1522
critical.css
1623
grunt_output
24+
25+
# Keldon files
26+
keldon
27+
28+
# @template-customization-end

.vscode/extensions.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"recommendations": [
55
"esbenp.prettier-vscode", // The TypeScript formatter
66
"dbaeumer.vscode-eslint", // The TypeScript linter
7+
"streetsidesoftware.code-spell-checker", // A spell-checker extension based on CSpell
8+
9+
// @template-customization-start
710
"orta.vscode-jest", // The TypeScript tester
811
"golang.go", // Golang language server
912
"ms-python.python", // Python language server
10-
"streetsidesoftware.code-spell-checker", // A spell-checker extension based on CSpell
13+
// @template-customization-end
1114
],
1215
}

.vscode/settings.json

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
"editor.tabSize": 2,
1010

1111
"files.associations": {
12-
"*.tmpl": "html", // Golang HTML templates are saved as "tmpl" files.
1312
".env*": "shellscript", // e.g. ".env.example" is the same as ".env".
13+
// @template-customization-start
14+
"*.tmpl": "html", // Golang HTML templates are saved as "tmpl" files.
15+
// @template-customization-end
1416
},
1517

1618
// We want to always use "lf" to be consistent with all platforms.
@@ -21,17 +23,19 @@
2123

2224
// Configure glob patterns for excluding files and folders in full text searches and quick open.
2325
"search.exclude": {
24-
"**/*.min.js*": true,
2526
"**/*.mp3": true,
2627
"**/*.png": true,
2728
"**/*.svg": true,
2829
"**/*.wav": true,
2930
"**/.yarn/": true,
3031
"**/dist/": true,
31-
"**/misc/keldon/": true,
3232
"**/node_modules/": true,
33+
// @template-customization-start
34+
"**/*.min.js*": true,
35+
"**/misc/keldon/": true,
3336
"**/server_old/": true,
3437
"**/card-images/": true,
38+
// @template-customization-end
3539
},
3640

3741
// ------------------
@@ -49,6 +53,18 @@
4953
"javascript.suggest.completeFunctionCalls": true,
5054
"typescript.suggest.completeFunctionCalls": true,
5155

56+
// By default, VSCode will prefer non-relative paths for deeply nested files.
57+
// @template-ignore-block-start
58+
// "javascript.preferences.importModuleSpecifier": "relative",
59+
// "typescript.preferences.importModuleSpecifier": "relative",
60+
// @template-ignore-block-end
61+
62+
// @template-customization-start
63+
// Using a value of "relative" prevents "@hanabi"-style imports.
64+
"javascript.preferences.importModuleSpecifier": "project-relative",
65+
"typescript.preferences.importModuleSpecifier": "project-relative",
66+
// @template-customization-end
67+
5268
// Show TypeScript errors for files that don't happen to be currently open, which makes TypeScript
5369
// work similar to other compiled languages like Golang or Rust.
5470
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
@@ -66,6 +82,18 @@
6682
"editor.formatOnSave": true,
6783
"editor.tabSize": 2,
6884
},
85+
"[javascriptreact]": {
86+
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
87+
"editor.defaultFormatter": "esbenp.prettier-vscode",
88+
"editor.formatOnSave": true,
89+
"editor.tabSize": 2,
90+
},
91+
"[typescriptreact]": {
92+
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
93+
"editor.defaultFormatter": "esbenp.prettier-vscode",
94+
"editor.formatOnSave": true,
95+
"editor.tabSize": 2,
96+
},
6997
"[json]": {
7098
"editor.defaultFormatter": "esbenp.prettier-vscode",
7199
"editor.formatOnSave": true,
@@ -96,6 +124,12 @@
96124
"editor.formatOnSave": true,
97125
"editor.tabSize": 2,
98126
},
127+
"[postcss]": {
128+
"editor.defaultFormatter": "esbenp.prettier-vscode",
129+
"editor.formatOnSave": true,
130+
"editor.tabSize": 2,
131+
},
132+
// @template-customization-start
99133
"[go]": {
100134
"editor.tabSize": 4,
101135
"editor.insertSpaces": false,
@@ -105,4 +139,5 @@
105139
"editor.formatOnSave": true,
106140
"editor.tabSize": 4,
107141
},
142+
// @template-customization-end
108143
}

LICENSE

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

4-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
{one line to give the program's name and a brief idea of what it does.}
635-
Copyright (C) {year} {name of author}
634+
<one line to give the program's name and a brief idea of what it does.>
635+
Copyright (C) <year> <name of author>
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -645,14 +645,14 @@ the "copyright" line and a pointer to where the full notice is found.
645645
GNU General Public License for more details.
646646

647647
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <http://www.gnu.org/licenses/>.
648+
along with this program. If not, see <https://www.gnu.org/licenses/>.
649649

650650
Also add information on how to contact you by electronic and paper mail.
651651

652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
{project} Copyright (C) {year} {fullname}
655+
<program> Copyright (C) <year> <name of author>
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
664664
You should also get your employer (if you work as a programmer) or school,
665665
if any, to sign a "copyright disclaimer" for the program, if necessary.
666666
For more information on this, and how to apply and follow the GNU GPL, see
667-
<http://www.gnu.org/licenses/>.
667+
<https://www.gnu.org/licenses/>.
668668

669669
The GNU General Public License does not permit incorporating your program
670670
into proprietary programs. If your program is a subroutine library, you
671671
may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674-
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
674+
<https://www.gnu.org/licenses/why-not-lgpl.html>.

lint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ wait
3131

3232
# TODO: https://stackoverflow.com/questions/49513335/bash-wait-exit-on-error-code
3333

34+
npx isaacscript check-ts --ignore "build.sh,ci.yml,cspell.json,lint.sh,publish.sh,run.sh,tsconfig.json"
35+
3436
echo "Successfully linted $REPO_NAME in $SECONDS seconds."

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
"@fastify/view": "^8.0.0",
2525
"@t3-oss/env-core": "^0.6.1",
2626
"@total-typescript/ts-reset": "^0.5.1",
27-
"@tsconfig/node-lts": "^18.12.3",
28-
"@types/jest": "^29.5.3",
29-
"@types/jquery": "^3.5.16",
30-
"@types/jsdom": "^21.1.1",
27+
"@tsconfig/node-lts": "^18.12.4",
28+
"@types/jest": "^29.5.4",
29+
"@types/jquery": "^3.5.17",
30+
"@types/jsdom": "^21.1.2",
3131
"@types/linkifyjs": "^2.1.4",
3232
"@types/lodash": "^4.14.197",
33-
"@types/node": "^20.5.1",
33+
"@types/node": "^20.5.3",
3434
"@types/tooltipster": "^0.0.32",
3535
"bufferutil": "^4.0.7",
3636
"canvas": "^2.11.2",
3737
"dotenv": "^16.3.1",
38-
"drizzle-orm": "^0.28.2",
38+
"drizzle-orm": "^0.28.3",
3939
"esbuild": "^0.19.2",
4040
"esbuild-plugin-pino": "^2.0.1",
41-
"eta": "^3.1.0",
41+
"eta": "^3.1.1",
4242
"fast-deep-equal": "^3.1.3",
4343
"fastify": "^4.21.0",
4444
"fastify-favicon": "^4.3.0",
@@ -49,10 +49,10 @@
4949
"http-status-codes": "^2.2.0",
5050
"immer": "^10.0.2",
5151
"interactjs": "^1.10.18",
52-
"isaacscript": "^3.7.2",
52+
"isaacscript": "^3.9.1",
5353
"isaacscript-lint": "^5.4.0",
5454
"isaacscript-tsconfig": "^4.0.0",
55-
"jest": "^29.6.2",
55+
"jest": "^29.6.3",
5656
"jquery": "^3.7.0",
5757
"jsdom": "^22.1.0",
5858
"jsonc-parser": "^3.2.0",
@@ -68,7 +68,7 @@
6868
"prettier-plugin-go-template": "^0.0.15",
6969
"prettier-plugin-organize-imports": "^3.2.3",
7070
"redux": "^4.2.1",
71-
"stacktracify": "^1.0.3",
71+
"stacktracify": "^1.0.4",
7272
"tooltipster": "^4.2.8",
7373
"ts-jest": "^29.1.1",
7474
"tsconfig": "^7.0.0",
@@ -77,7 +77,7 @@
7777
"typescript": "^5.1.6",
7878
"ws": "^8.13.0",
7979
"xmlserializer": "^0.6.1",
80-
"zod": "^3.22.1"
80+
"zod": "^3.22.2"
8181
},
8282
"packageManager": "[email protected]"
8383
}

prettier.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
/** @type {import("prettier").Config} */
55
const config = {
6+
// @template-ignore-next-line
67
plugins: ["prettier-plugin-organize-imports", "prettier-plugin-go-template"],
78

89
overrides: [

todo.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
+------+
44

55
- search for "Number("
6-
- search for all 6 constants (to replace with MAX_SUITS_IN_A_VARIANT)
76
- search for "for (let"
87
- fix eta undefined passing through to template (use Discord advice)
9-
- remove type assertions from sudoku.ts (need feedback from Ram)
108
- remove type assertions from lobby + views
119
- PlayerIndex type (maybe, look to see if it is useful first)
1210
- redo install instructions without choco
1311
- refactor START_CARD_RANK from 7 --> 0 (might affect database?)
1412

13+
waiting to hear back:
14+
- remove type assertions from sudoku.ts (need feedback from Ram)
15+
1516
short term:
1617
- refactor soundTypeForLastAction (should probably delete the whole thing)
1718
- getPlayerNames comma is in wrong place for 3+ players

tsconfig.eslint.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// The configuration file for TypeScript.
1+
// A special TypeScript configuration file, used by ESLint only.
22
{
3-
// We extend the Node.js IsaacScript config:
4-
// https://github.com/IsaacScript/isaacscript/blob/main/packages/isaacscript-tsconfig/tsconfig.node.json
5-
"extends": "isaacscript-tsconfig/tsconfig.node.json",
3+
"extends": "./tsconfig.json",
64

75
// We want to lint every file in the repository, regardless of whether it is actually bundled into
86
// the TypeScript output or not. Two entries for each file extension are needed because TypeScript

0 commit comments

Comments
 (0)