Skip to content

Commit 30ee296

Browse files
authored
Upgrade to TS 5.8, ESLint v9, Vite v6 and other dependencies (#334)
* Update workflow * Make submodule protocol agnostic * Reformat * Update ESLint to v9 and related dependencies * Fix auto-fixable ESLint warnings * Bump TS to 5.7 and sass to 1.85 * Deduplicate dependencies * Fix compile errors post-updates * Update gitignore * Add package manager version to package.json * Fix auto-fixable problems * Fix ESLint breaking change * Update TS config files for safety * Fix test script * Update lockfile post-merge * Deduplicate dependencies * Upgrade TypeScript to v5.8 * Upgrade Vite to v6 * Deduplicate dependencies
1 parent f496c49 commit 30ee296

File tree

38 files changed

+525
-2093
lines changed

38 files changed

+525
-2093
lines changed

.github/workflows/pages-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: cp -r src/java build
3131

3232
- name: Deploy 🚀
33-
uses: peaceiris/actions-gh-pages@v3
33+
uses: peaceiris/actions-gh-pages@v4
3434
with:
3535
github_token: ${{ secrets.GITHUB_TOKEN }}
3636
publish_dir: ./build # The folder the action should deploy.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
node_modules/
55
devserver/node_modules
66
build/*
7-
/package-lock.json
87
coverage/
98

109
scripts/dist

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "src/java/java-packages"]
22
path = src/java/java-packages
3-
url = https://github.com/source-academy/java-packages
3+
url = ../../source-academy/java-packages.git

devserver/tsconfig.json

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

1818
/* Linting */
1919
"strict": true,
20+
"forceConsistentCasingInFileNames": true,
2021
"noUnusedLocals": true,
2122
"noUnusedParameters": true,
2223
"noFallthroughCasesInSwitch": true,

package.json

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,32 @@
6363
"@types/react": "^18.3.2",
6464
"@types/react-dom": "^18.3.0",
6565
"@types/three": "^0.163.0",
66-
"@vitejs/plugin-react": "^4.2.1",
66+
"@vitejs/plugin-react": "^4.3.4",
6767
"acorn": "^8.8.1",
6868
"acorn-jsx": "^5.3.2",
6969
"astring": "^1.8.6",
7070
"chalk": "^5.0.1",
7171
"commander": "^12.0.0",
7272
"console-table-printer": "^2.11.1",
7373
"esbuild": "^0.25.0",
74-
"eslint": "^8.57.0",
75-
"eslint-plugin-import": "^2.29.1",
76-
"eslint-plugin-jest": "^27.9.0",
77-
"eslint-plugin-jsx-a11y": "^6.5.1",
74+
"eslint": "^9.21.0",
75+
"eslint-plugin-import": "^2.31.0",
76+
"eslint-plugin-jest": "^28.11.0",
77+
"eslint-plugin-jsx-a11y": "^6.10.2",
7878
"eslint-plugin-react": "^7.37.4",
79-
"eslint-plugin-react-hooks": "^4.4.0",
79+
"eslint-plugin-react-hooks": "^5.1.0",
8080
"globals": "^15.11.0",
8181
"http-server": "^0.12.3",
8282
"husky": "^9.0.11",
8383
"jest": "^29.7.0",
8484
"jest-environment-jsdom": "^29.4.1",
8585
"re-resizable": "^6.9.11",
86-
"sass": "^1.66.1",
86+
"sass": "^1.85.0",
8787
"ts-jest": "^29.1.2",
8888
"typedoc": "^0.25.12",
89-
"typescript": "^5.4.3",
90-
"typescript-eslint": "^8.11.0",
91-
"vite": "^5.4.15",
89+
"typescript": "^5.8.2",
90+
"typescript-eslint": "^8.24.1",
91+
"vite": "^6.2.4",
9292
"yarnhook": "^0.5.1"
9393
},
9494
"dependencies": {
@@ -105,7 +105,7 @@
105105
"dayjs": "^1.10.4",
106106
"events": "^3.3.0",
107107
"gl-matrix": "^3.3.0",
108-
"js-slang": "^1.0.74",
108+
"js-slang": "^1.0.81",
109109
"lodash": "^4.17.21",
110110
"mqtt": "^4.3.7",
111111
"nbody": "^0.1.1",
@@ -133,8 +133,5 @@
133133
"scripts/jest.config.js"
134134
]
135135
},
136-
"resolutions": {
137-
"**/gl": "^8.0.2"
138-
},
139136
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
140137
}

scripts/src/build/docs/__tests__/test_mocks/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"skipLibCheck": true,
2727
/* The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness. */
2828
"strict": true,
29+
"forceConsistentCasingInFileNames": true,
2930
/* The target setting changes which JS features are downleveled and which are left intact. */
3031
"target": "es6",
3132
/* In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type. */

scripts/src/build/prebuild/lint.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import chalk from 'chalk';
2-
/*
3-
Unfortunately, people like to leave parts of their API
4-
undocumented, so using the FlatConfig linter with the
5-
current version of eslint means we can't get any
6-
typing for it
7-
*/
8-
// @ts-expect-error 2305
92
import { loadESLint, type ESLint } from 'eslint';
103
import { lintFixOption, retrieveBundlesAndTabs, wrapWithTimer } from '@src/commandUtils';
11-
import { findSeverity, divideAndRound, type Severity, type AwaitedReturn } from '../utils';
4+
import { divideAndRound, findSeverity, type AwaitedReturn, type Severity } from '../utils';
125
import { createPrebuildCommand, createPrebuildCommandHandler, type PrebuildOptions } from './utils';
136

147
interface LintResults {

scripts/src/linting/__tests__/typeimports.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import typeImportsPlugin from '../typeimports';
33

44
describe('Test collateTypeImports', () => {
55
const tester = new RuleTester({
6-
parser: require.resolve('@typescript-eslint/parser'),
7-
parserOptions: {
8-
ecmaVersion: 6,
9-
sourceType: 'module'
10-
}
6+
'languageOptions': {
7+
// eslint-disable-next-line @typescript-eslint/no-require-imports
8+
parser: require('@typescript-eslint/parser'),
9+
parserOptions: {
10+
ecmaVersion: 6,
11+
sourceType: 'module'
12+
}
13+
},
1114
});
1215

1316
tester.run(

scripts/src/linting/typeimports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const typeImportsPlugin = {
2828
},
2929
create: context => ({
3030
ImportDeclaration(node) {
31-
// @ts-expect-error import kind is unknown property
3231
if (node.importKind === 'type' || node.specifiers.length === 0) return;
3332

3433
// @ts-expect-error import kind is unknown property

scripts/src/templates/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { addNew as addNewTab } from './tab';
88

99
async function askMode(rl: Interface) {
1010
while (true) {
11-
// eslint-disable-next-line no-await-in-loop
1211
const mode = await askQuestion('What would you like to create? (module/tab)', rl);
1312
if (mode !== 'module' && mode !== 'tab') {
1413
warn("Please answer with only 'module' or 'tab'.");

0 commit comments

Comments
 (0)