diff options
Diffstat (limited to 'subprojects')
33 files changed, 43 insertions, 52 deletions
diff --git a/subprojects/frontend/.eslintrc.cjs b/subprojects/frontend/.eslintrc.cjs index 0bf65c4f..eadd3fb4 100644 --- a/subprojects/frontend/.eslintrc.cjs +++ b/subprojects/frontend/.eslintrc.cjs | |||
@@ -67,6 +67,8 @@ module.exports = { | |||
67 | ], | 67 | ], |
68 | // Use prop spreading to conditionally add props with `exactOptionalPropertyTypes`. | 68 | // Use prop spreading to conditionally add props with `exactOptionalPropertyTypes`. |
69 | 'react/jsx-props-no-spreading': 'off', | 69 | 'react/jsx-props-no-spreading': 'off', |
70 | // We use the `react-jsx` runtime, so there is no need to import `React`. | ||
71 | 'react/react-in-jsx-scope': 'off', | ||
70 | }, | 72 | }, |
71 | overrides: [ | 73 | overrides: [ |
72 | { | 74 | { |
diff --git a/subprojects/frontend/package.json b/subprojects/frontend/package.json index 4a890ee5..3bc84d6e 100644 --- a/subprojects/frontend/package.json +++ b/subprojects/frontend/package.json | |||
@@ -38,8 +38,8 @@ | |||
38 | "@lezer/highlight": "^1.1.2", | 38 | "@lezer/highlight": "^1.1.2", |
39 | "@lezer/lr": "^1.2.5", | 39 | "@lezer/lr": "^1.2.5", |
40 | "@material-icons/svg": "^1.0.33", | 40 | "@material-icons/svg": "^1.0.33", |
41 | "@mui/icons-material": "5.10.14", | 41 | "@mui/icons-material": "5.10.15", |
42 | "@mui/material": "5.10.14", | 42 | "@mui/material": "5.10.15", |
43 | "ansi-styles": "^6.2.1", | 43 | "ansi-styles": "^6.2.1", |
44 | "escape-string-regexp": "^5.0.0", | 44 | "escape-string-regexp": "^5.0.0", |
45 | "lodash-es": "^4.17.21", | 45 | "lodash-es": "^4.17.21", |
@@ -57,6 +57,7 @@ | |||
57 | }, | 57 | }, |
58 | "devDependencies": { | 58 | "devDependencies": { |
59 | "@lezer/generator": "^1.1.3", | 59 | "@lezer/generator": "^1.1.3", |
60 | "@tsconfig/node18-strictest-esm": "^1.0.1", | ||
60 | "@types/eslint": "^8.4.10", | 61 | "@types/eslint": "^8.4.10", |
61 | "@types/html-minifier-terser": "^7.0.0", | 62 | "@types/html-minifier-terser": "^7.0.0", |
62 | "@types/lodash-es": "^4.17.6", | 63 | "@types/lodash-es": "^4.17.6", |
@@ -65,8 +66,8 @@ | |||
65 | "@types/prettier": "^2.7.1", | 66 | "@types/prettier": "^2.7.1", |
66 | "@types/react": "^18.0.25", | 67 | "@types/react": "^18.0.25", |
67 | "@types/react-dom": "^18.0.9", | 68 | "@types/react-dom": "^18.0.9", |
68 | "@typescript-eslint/eslint-plugin": "^5.43.0", | 69 | "@typescript-eslint/eslint-plugin": "^5.44.0", |
69 | "@typescript-eslint/parser": "^5.43.0", | 70 | "@typescript-eslint/parser": "^5.44.0", |
70 | "@vitejs/plugin-react": "^2.2.0", | 71 | "@vitejs/plugin-react": "^2.2.0", |
71 | "@xstate/cli": "^0.3.3", | 72 | "@xstate/cli": "^0.3.3", |
72 | "cross-env": "^7.0.3", | 73 | "cross-env": "^7.0.3", |
@@ -81,7 +82,7 @@ | |||
81 | "eslint-plugin-prettier": "^4.2.1", | 82 | "eslint-plugin-prettier": "^4.2.1", |
82 | "eslint-plugin-react": "^7.31.11", | 83 | "eslint-plugin-react": "^7.31.11", |
83 | "eslint-plugin-react-hooks": "^4.6.0", | 84 | "eslint-plugin-react-hooks": "^4.6.0", |
84 | "html-minifier-terser": "^7.0.0", | 85 | "html-minifier-terser": "^7.1.0", |
85 | "prettier": "^2.7.1", | 86 | "prettier": "^2.7.1", |
86 | "typescript": "4.9.3", | 87 | "typescript": "4.9.3", |
87 | "vite": "^3.2.4", | 88 | "vite": "^3.2.4", |
diff --git a/subprojects/frontend/src/App.tsx b/subprojects/frontend/src/App.tsx index a471690b..b162e551 100644 --- a/subprojects/frontend/src/App.tsx +++ b/subprojects/frontend/src/App.tsx | |||
@@ -1,6 +1,6 @@ | |||
1 | import Box from '@mui/material/Box'; | 1 | import Box from '@mui/material/Box'; |
2 | import CssBaseline from '@mui/material/CssBaseline'; | 2 | import CssBaseline from '@mui/material/CssBaseline'; |
3 | import React, { StrictMode, Suspense, lazy } from 'react'; | 3 | import { StrictMode, Suspense, lazy } from 'react'; |
4 | 4 | ||
5 | import Loading from './Loading'; | 5 | import Loading from './Loading'; |
6 | import type RootStore from './RootStore'; | 6 | import type RootStore from './RootStore'; |
diff --git a/subprojects/frontend/src/Loading.tsx b/subprojects/frontend/src/Loading.tsx index 8c293239..489563e0 100644 --- a/subprojects/frontend/src/Loading.tsx +++ b/subprojects/frontend/src/Loading.tsx | |||
@@ -1,6 +1,5 @@ | |||
1 | import CircularProgress from '@mui/material/CircularProgress'; | 1 | import CircularProgress from '@mui/material/CircularProgress'; |
2 | import { styled } from '@mui/material/styles'; | 2 | import { styled } from '@mui/material/styles'; |
3 | import React from 'react'; | ||
4 | 3 | ||
5 | const LoadingRoot = styled('div')(({ theme }) => ({ | 4 | const LoadingRoot = styled('div')(({ theme }) => ({ |
6 | width: '100%', | 5 | width: '100%', |
diff --git a/subprojects/frontend/src/Refinery.tsx b/subprojects/frontend/src/Refinery.tsx index 41f835b3..d6bd6159 100644 --- a/subprojects/frontend/src/Refinery.tsx +++ b/subprojects/frontend/src/Refinery.tsx | |||
@@ -1,7 +1,6 @@ | |||
1 | import Grow from '@mui/material/Grow'; | 1 | import Grow from '@mui/material/Grow'; |
2 | import Stack from '@mui/material/Stack'; | 2 | import Stack from '@mui/material/Stack'; |
3 | import { SnackbarProvider } from 'notistack'; | 3 | import { SnackbarProvider } from 'notistack'; |
4 | import React from 'react'; | ||
5 | 4 | ||
6 | import TopBar from './TopBar'; | 5 | import TopBar from './TopBar'; |
7 | import UpdateNotification from './UpdateNotification'; | 6 | import UpdateNotification from './UpdateNotification'; |
diff --git a/subprojects/frontend/src/RootStoreProvider.tsx b/subprojects/frontend/src/RootStoreProvider.tsx index 70ac7776..2c11a0f9 100644 --- a/subprojects/frontend/src/RootStoreProvider.tsx +++ b/subprojects/frontend/src/RootStoreProvider.tsx | |||
@@ -1,4 +1,4 @@ | |||
1 | import React, { type ReactNode, createContext, useContext } from 'react'; | 1 | import { type ReactNode, createContext, useContext } from 'react'; |
2 | 2 | ||
3 | import type RootStore from './RootStore'; | 3 | import type RootStore from './RootStore'; |
4 | 4 | ||
diff --git a/subprojects/frontend/src/ToggleDarkModeButton.tsx b/subprojects/frontend/src/ToggleDarkModeButton.tsx index 52606242..59714f20 100644 --- a/subprojects/frontend/src/ToggleDarkModeButton.tsx +++ b/subprojects/frontend/src/ToggleDarkModeButton.tsx | |||
@@ -2,7 +2,6 @@ import DarkModeIcon from '@mui/icons-material/DarkMode'; | |||
2 | import LightModeIcon from '@mui/icons-material/LightMode'; | 2 | import LightModeIcon from '@mui/icons-material/LightMode'; |
3 | import IconButton from '@mui/material/IconButton'; | 3 | import IconButton from '@mui/material/IconButton'; |
4 | import { observer } from 'mobx-react-lite'; | 4 | import { observer } from 'mobx-react-lite'; |
5 | import React from 'react'; | ||
6 | 5 | ||
7 | import { useRootStore } from './RootStoreProvider'; | 6 | import { useRootStore } from './RootStoreProvider'; |
8 | 7 | ||
diff --git a/subprojects/frontend/src/TopBar.tsx b/subprojects/frontend/src/TopBar.tsx index 79ea0b65..c943f7c4 100644 --- a/subprojects/frontend/src/TopBar.tsx +++ b/subprojects/frontend/src/TopBar.tsx | |||
@@ -5,7 +5,7 @@ import { useTheme } from '@mui/material/styles'; | |||
5 | import useMediaQuery from '@mui/material/useMediaQuery'; | 5 | import useMediaQuery from '@mui/material/useMediaQuery'; |
6 | import { throttle } from 'lodash-es'; | 6 | import { throttle } from 'lodash-es'; |
7 | import { observer } from 'mobx-react-lite'; | 7 | import { observer } from 'mobx-react-lite'; |
8 | import React, { useEffect, useMemo, useState } from 'react'; | 8 | import { useEffect, useMemo, useState } from 'react'; |
9 | 9 | ||
10 | import { useRootStore } from './RootStoreProvider'; | 10 | import { useRootStore } from './RootStoreProvider'; |
11 | import ToggleDarkModeButton from './ToggleDarkModeButton'; | 11 | import ToggleDarkModeButton from './ToggleDarkModeButton'; |
diff --git a/subprojects/frontend/src/UpdateNotification.tsx b/subprojects/frontend/src/UpdateNotification.tsx index 8c46186a..07f7f5f7 100644 --- a/subprojects/frontend/src/UpdateNotification.tsx +++ b/subprojects/frontend/src/UpdateNotification.tsx | |||
@@ -1,6 +1,6 @@ | |||
1 | import Button from '@mui/material/Button'; | 1 | import Button from '@mui/material/Button'; |
2 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
3 | import React, { useEffect } from 'react'; | 3 | import { useEffect } from 'react'; |
4 | 4 | ||
5 | import { useRootStore } from './RootStoreProvider'; | 5 | import { useRootStore } from './RootStoreProvider'; |
6 | import { ContrastThemeProvider } from './theme/ThemeProvider'; | 6 | import { ContrastThemeProvider } from './theme/ThemeProvider'; |
diff --git a/subprojects/frontend/src/editor/AnimatedButton.tsx b/subprojects/frontend/src/editor/AnimatedButton.tsx index d08decbc..7f6c61f0 100644 --- a/subprojects/frontend/src/editor/AnimatedButton.tsx +++ b/subprojects/frontend/src/editor/AnimatedButton.tsx | |||
@@ -1,7 +1,7 @@ | |||
1 | import Box from '@mui/material/Box'; | 1 | import Box from '@mui/material/Box'; |
2 | import Button from '@mui/material/Button'; | 2 | import Button from '@mui/material/Button'; |
3 | import { styled } from '@mui/material/styles'; | 3 | import { styled } from '@mui/material/styles'; |
4 | import React, { type ReactNode, useLayoutEffect, useState } from 'react'; | 4 | import { type ReactNode, useLayoutEffect, useState } from 'react'; |
5 | 5 | ||
6 | const AnimatedButtonBase = styled(Button, { | 6 | const AnimatedButtonBase = styled(Button, { |
7 | shouldForwardProp: (prop) => prop !== 'width', | 7 | shouldForwardProp: (prop) => prop !== 'width', |
diff --git a/subprojects/frontend/src/editor/ConnectButton.tsx b/subprojects/frontend/src/editor/ConnectButton.tsx index 52e7b854..e2d251f3 100644 --- a/subprojects/frontend/src/editor/ConnectButton.tsx +++ b/subprojects/frontend/src/editor/ConnectButton.tsx | |||
@@ -5,7 +5,6 @@ import SyncProblemIcon from '@mui/icons-material/SyncProblem'; | |||
5 | import IconButton from '@mui/material/IconButton'; | 5 | import IconButton from '@mui/material/IconButton'; |
6 | import { keyframes, styled } from '@mui/material/styles'; | 6 | import { keyframes, styled } from '@mui/material/styles'; |
7 | import { observer } from 'mobx-react-lite'; | 7 | import { observer } from 'mobx-react-lite'; |
8 | import React from 'react'; | ||
9 | 8 | ||
10 | import type EditorStore from './EditorStore'; | 9 | import type EditorStore from './EditorStore'; |
11 | 10 | ||
diff --git a/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx b/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx index f7f089f0..9b27f45c 100644 --- a/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx +++ b/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx | |||
@@ -1,6 +1,6 @@ | |||
1 | import Button from '@mui/material/Button'; | 1 | import Button from '@mui/material/Button'; |
2 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
3 | import React, { useEffect } from 'react'; | 3 | import { useEffect } from 'react'; |
4 | 4 | ||
5 | import { ContrastThemeProvider } from '../theme/ThemeProvider'; | 5 | import { ContrastThemeProvider } from '../theme/ThemeProvider'; |
6 | import useDelayedSnackbar from '../utils/useDelayedSnackbar'; | 6 | import useDelayedSnackbar from '../utils/useDelayedSnackbar'; |
diff --git a/subprojects/frontend/src/editor/EditorArea.tsx b/subprojects/frontend/src/editor/EditorArea.tsx index 95f0f92e..cfb988b2 100644 --- a/subprojects/frontend/src/editor/EditorArea.tsx +++ b/subprojects/frontend/src/editor/EditorArea.tsx | |||
@@ -1,7 +1,7 @@ | |||
1 | import Box from '@mui/material/Box'; | 1 | import Box from '@mui/material/Box'; |
2 | import { useTheme } from '@mui/material/styles'; | 2 | import { useTheme } from '@mui/material/styles'; |
3 | import { observer } from 'mobx-react-lite'; | 3 | import { observer } from 'mobx-react-lite'; |
4 | import React, { useCallback, useEffect } from 'react'; | 4 | import { useCallback, useEffect } from 'react'; |
5 | 5 | ||
6 | import type EditorStore from './EditorStore'; | 6 | import type EditorStore from './EditorStore'; |
7 | import EditorTheme from './EditorTheme'; | 7 | import EditorTheme from './EditorTheme'; |
diff --git a/subprojects/frontend/src/editor/EditorButtons.tsx b/subprojects/frontend/src/editor/EditorButtons.tsx index fd046d46..53b06e23 100644 --- a/subprojects/frontend/src/editor/EditorButtons.tsx +++ b/subprojects/frontend/src/editor/EditorButtons.tsx | |||
@@ -13,7 +13,6 @@ import Stack from '@mui/material/Stack'; | |||
13 | import ToggleButton from '@mui/material/ToggleButton'; | 13 | import ToggleButton from '@mui/material/ToggleButton'; |
14 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; | 14 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; |
15 | import { observer } from 'mobx-react-lite'; | 15 | import { observer } from 'mobx-react-lite'; |
16 | import React from 'react'; | ||
17 | 16 | ||
18 | import ConnectButton from './ConnectButton'; | 17 | import ConnectButton from './ConnectButton'; |
19 | import type EditorStore from './EditorStore'; | 18 | import type EditorStore from './EditorStore'; |
diff --git a/subprojects/frontend/src/editor/EditorPane.tsx b/subprojects/frontend/src/editor/EditorPane.tsx index 0db4b892..1d51b3f5 100644 --- a/subprojects/frontend/src/editor/EditorPane.tsx +++ b/subprojects/frontend/src/editor/EditorPane.tsx | |||
@@ -5,7 +5,7 @@ import Toolbar from '@mui/material/Toolbar'; | |||
5 | import { useTheme } from '@mui/material/styles'; | 5 | import { useTheme } from '@mui/material/styles'; |
6 | import useMediaQuery from '@mui/material/useMediaQuery'; | 6 | import useMediaQuery from '@mui/material/useMediaQuery'; |
7 | import { observer } from 'mobx-react-lite'; | 7 | import { observer } from 'mobx-react-lite'; |
8 | import React, { useState } from 'react'; | 8 | import { useState } from 'react'; |
9 | 9 | ||
10 | import { useRootStore } from '../RootStoreProvider'; | 10 | import { useRootStore } from '../RootStoreProvider'; |
11 | 11 | ||
diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index acad3d09..d966690c 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts | |||
@@ -1,4 +1,7 @@ | |||
1 | import { CompletionContext, CompletionResult } from '@codemirror/autocomplete'; | 1 | import type { |
2 | CompletionContext, | ||
3 | CompletionResult, | ||
4 | } from '@codemirror/autocomplete'; | ||
2 | import { redo, redoDepth, undo, undoDepth } from '@codemirror/commands'; | 5 | import { redo, redoDepth, undo, undoDepth } from '@codemirror/commands'; |
3 | import { | 6 | import { |
4 | type Diagnostic, | 7 | type Diagnostic, |
diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx index 8b6ae660..1a32f5ce 100644 --- a/subprojects/frontend/src/editor/GenerateButton.tsx +++ b/subprojects/frontend/src/editor/GenerateButton.tsx | |||
@@ -2,7 +2,6 @@ import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; | |||
2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; | 2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; |
3 | import Button from '@mui/material/Button'; | 3 | import Button from '@mui/material/Button'; |
4 | import { observer } from 'mobx-react-lite'; | 4 | import { observer } from 'mobx-react-lite'; |
5 | import React from 'react'; | ||
6 | 5 | ||
7 | import AnimatedButton from './AnimatedButton'; | 6 | import AnimatedButton from './AnimatedButton'; |
8 | import type EditorStore from './EditorStore'; | 7 | import type EditorStore from './EditorStore'; |
diff --git a/subprojects/frontend/src/editor/SearchPanelPortal.tsx b/subprojects/frontend/src/editor/SearchPanelPortal.tsx index b6b375e3..5cf1c90e 100644 --- a/subprojects/frontend/src/editor/SearchPanelPortal.tsx +++ b/subprojects/frontend/src/editor/SearchPanelPortal.tsx | |||
@@ -1,6 +1,5 @@ | |||
1 | import Portal from '@mui/material/Portal'; | 1 | import Portal from '@mui/material/Portal'; |
2 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
3 | import React from 'react'; | ||
4 | 3 | ||
5 | import type EditorStore from './EditorStore'; | 4 | import type EditorStore from './EditorStore'; |
6 | import SearchToolbar from './SearchToolbar'; | 5 | import SearchToolbar from './SearchToolbar'; |
diff --git a/subprojects/frontend/src/editor/SearchToolbar.tsx b/subprojects/frontend/src/editor/SearchToolbar.tsx index a9b9811d..54f3dba7 100644 --- a/subprojects/frontend/src/editor/SearchToolbar.tsx +++ b/subprojects/frontend/src/editor/SearchToolbar.tsx | |||
@@ -14,7 +14,7 @@ import Toolbar from '@mui/material/Toolbar'; | |||
14 | import { styled } from '@mui/material/styles'; | 14 | import { styled } from '@mui/material/styles'; |
15 | import useMediaQuery from '@mui/material/useMediaQuery'; | 15 | import useMediaQuery from '@mui/material/useMediaQuery'; |
16 | import { observer } from 'mobx-react-lite'; | 16 | import { observer } from 'mobx-react-lite'; |
17 | import React, { useCallback, useState } from 'react'; | 17 | import { useCallback, useState } from 'react'; |
18 | 18 | ||
19 | import type SearchPanelStore from './SearchPanelStore'; | 19 | import type SearchPanelStore from './SearchPanelStore'; |
20 | 20 | ||
diff --git a/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts b/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts index 96be0eea..d5ad536b 100644 --- a/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts +++ b/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts | |||
@@ -91,7 +91,7 @@ function getNumIndentMarkersForNonEmptyLine( | |||
91 | ) { | 91 | ) { |
92 | let numIndents = 0; | 92 | let numIndents = 0; |
93 | let numConsecutiveSpaces = 0; | 93 | let numConsecutiveSpaces = 0; |
94 | let prevChar: string | null = null; | 94 | let prevChar: string | undefined; |
95 | 95 | ||
96 | for (let char = 0; char < text.length; char += 1) { | 96 | for (let char = 0; char < text.length; char += 1) { |
97 | // Bail if we encounter a non-whitespace character | 97 | // Bail if we encounter a non-whitespace character |
diff --git a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts index c95e581d..0edaeb70 100644 --- a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts +++ b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts | |||
@@ -128,10 +128,11 @@ export default function scrollbarViewPlugin( | |||
128 | Math.max(1, endLine - startLine) * lineHeight, | 128 | Math.max(1, endLine - startLine) * lineHeight, |
129 | ); | 129 | ); |
130 | 130 | ||
131 | let annotation: HTMLDivElement; | 131 | let annotation: HTMLDivElement | undefined; |
132 | if (i < annotations.length) { | 132 | if (i < annotations.length) { |
133 | annotation = annotations[i]; | 133 | annotation = annotations[i]; |
134 | } else { | 134 | } |
135 | if (annotation === undefined) { | ||
135 | annotation = ownerDocument.createElement('div'); | 136 | annotation = ownerDocument.createElement('div'); |
136 | annotations.push(annotation); | 137 | annotations.push(annotation); |
137 | holder.appendChild(annotation); | 138 | holder.appendChild(annotation); |
diff --git a/subprojects/frontend/src/index.tsx b/subprojects/frontend/src/index.tsx index a40f1762..3e56d941 100644 --- a/subprojects/frontend/src/index.tsx +++ b/subprojects/frontend/src/index.tsx | |||
@@ -1,5 +1,4 @@ | |||
1 | import { configure } from 'mobx'; | 1 | import { configure } from 'mobx'; |
2 | import React from 'react'; | ||
3 | import { type Root, createRoot } from 'react-dom/client'; | 2 | import { type Root, createRoot } from 'react-dom/client'; |
4 | 3 | ||
5 | import App from './App'; | 4 | import App from './App'; |
diff --git a/subprojects/frontend/src/language/problem.grammar b/subprojects/frontend/src/language/problem.grammar index c2410913..f4cf1712 100644 --- a/subprojects/frontend/src/language/problem.grammar +++ b/subprojects/frontend/src/language/problem.grammar | |||
@@ -37,7 +37,7 @@ statement { | |||
37 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } | 37 | PredicateBody { ("<->" sep<OrOp, Conjunction>)? "." } |
38 | } | | 38 | } | |
39 | FunctionDefinition { | 39 | FunctionDefinition { |
40 | PrimitiveType RelationName ParameterList<Parameter>? | 40 | kw<"fn"> PrimitiveType RelationName ParameterList<Parameter>? |
41 | FunctionBody { ("=" sep<OrOp, Case>)? "." } | 41 | FunctionBody { ("=" sep<OrOp, Case>)? "." } |
42 | } | | 42 | } | |
43 | //RuleDefinition { | 43 | //RuleDefinition { |
diff --git a/subprojects/frontend/src/language/problemLanguageSupport.ts b/subprojects/frontend/src/language/problemLanguageSupport.ts index 497030e2..c3ae7ed9 100644 --- a/subprojects/frontend/src/language/problemLanguageSupport.ts +++ b/subprojects/frontend/src/language/problemLanguageSupport.ts | |||
@@ -21,7 +21,7 @@ const parserWithMetadata = parser.configure({ | |||
21 | styleTags({ | 21 | styleTags({ |
22 | LineComment: t.lineComment, | 22 | LineComment: t.lineComment, |
23 | BlockComment: t.blockComment, | 23 | BlockComment: t.blockComment, |
24 | 'problem class enum pred indiv scope': t.definitionKeyword, | 24 | 'problem class enum pred fn indiv scope': t.definitionKeyword, |
25 | 'abstract extends refers contains container opposite': t.modifier, | 25 | 'abstract extends refers contains container opposite': t.modifier, |
26 | 'default error contained containment': t.modifier, | 26 | 'default error contained containment': t.modifier, |
27 | 'true false unknown error': t.keyword, | 27 | 'true false unknown error': t.keyword, |
diff --git a/subprojects/frontend/src/theme/ThemeProvider.tsx b/subprojects/frontend/src/theme/ThemeProvider.tsx index a00d70fe..9cf870d5 100644 --- a/subprojects/frontend/src/theme/ThemeProvider.tsx +++ b/subprojects/frontend/src/theme/ThemeProvider.tsx | |||
@@ -12,7 +12,7 @@ import { | |||
12 | useTheme, | 12 | useTheme, |
13 | } from '@mui/material/styles'; | 13 | } from '@mui/material/styles'; |
14 | import { observer } from 'mobx-react-lite'; | 14 | import { observer } from 'mobx-react-lite'; |
15 | import React, { type ReactNode, createContext, useContext } from 'react'; | 15 | import { type ReactNode, createContext, useContext } from 'react'; |
16 | 16 | ||
17 | import { useRootStore } from '../RootStoreProvider'; | 17 | import { useRootStore } from '../RootStoreProvider'; |
18 | 18 | ||
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts index d0b24c1f..fd52cef1 100644 --- a/subprojects/frontend/src/utils/PendingTask.ts +++ b/subprojects/frontend/src/utils/PendingTask.ts | |||
@@ -20,6 +20,7 @@ export default class PendingTask<T> { | |||
20 | ) { | 20 | ) { |
21 | this.resolveCallback = resolveCallback; | 21 | this.resolveCallback = resolveCallback; |
22 | this.rejectCallback = rejectCallback; | 22 | this.rejectCallback = rejectCallback; |
23 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
23 | this.timeout = setTimeout(() => { | 24 | this.timeout = setTimeout(() => { |
24 | if (!this.resolved) { | 25 | if (!this.resolved) { |
25 | this.reject(new TimeoutError()); | 26 | this.reject(new TimeoutError()); |
diff --git a/subprojects/frontend/src/utils/useDelayedSnackbar.ts b/subprojects/frontend/src/utils/useDelayedSnackbar.ts index 03ad6caa..54716c0c 100644 --- a/subprojects/frontend/src/utils/useDelayedSnackbar.ts +++ b/subprojects/frontend/src/utils/useDelayedSnackbar.ts | |||
@@ -21,6 +21,7 @@ export default function useDelayedSnackbar( | |||
21 | delay = defaultDelay, | 21 | delay = defaultDelay, |
22 | ) => { | 22 | ) => { |
23 | let key: SnackbarKey | undefined; | 23 | let key: SnackbarKey | undefined; |
24 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
24 | let timeout: number | undefined = setTimeout(() => { | 25 | let timeout: number | undefined = setTimeout(() => { |
25 | timeout = undefined; | 26 | timeout = undefined; |
26 | key = enqueueSnackbar(message, options); | 27 | key = enqueueSnackbar(message, options); |
diff --git a/subprojects/frontend/src/xtext/OccurrencesService.ts b/subprojects/frontend/src/xtext/OccurrencesService.ts index 248a9a87..fc72ead2 100644 --- a/subprojects/frontend/src/xtext/OccurrencesService.ts +++ b/subprojects/frontend/src/xtext/OccurrencesService.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Transaction } from '@codemirror/state'; | 1 | import type { Transaction } from '@codemirror/state'; |
2 | import { debounce } from 'lodash-es'; | 2 | import { debounce } from 'lodash-es'; |
3 | import ms from 'ms'; | 3 | import ms from 'ms'; |
4 | 4 | ||
diff --git a/subprojects/frontend/src/xtext/webSocketMachine.ts b/subprojects/frontend/src/xtext/webSocketMachine.ts index 5f6bc604..216ed86a 100644 --- a/subprojects/frontend/src/xtext/webSocketMachine.ts +++ b/subprojects/frontend/src/xtext/webSocketMachine.ts | |||
@@ -205,7 +205,7 @@ export default createMachine( | |||
205 | ERROR_WAIT_TIME: ({ errors: { length: retryCount } }) => { | 205 | ERROR_WAIT_TIME: ({ errors: { length: retryCount } }) => { |
206 | const { length } = ERROR_WAIT_TIMES; | 206 | const { length } = ERROR_WAIT_TIMES; |
207 | const index = retryCount < length ? retryCount : length - 1; | 207 | const index = retryCount < length ? retryCount : length - 1; |
208 | return ERROR_WAIT_TIMES[index]; | 208 | return ERROR_WAIT_TIMES[index] ?? 0; |
209 | }, | 209 | }, |
210 | }, | 210 | }, |
211 | actions: { | 211 | actions: { |
diff --git a/subprojects/frontend/tsconfig.base.json b/subprojects/frontend/tsconfig.base.json index 9cc8ace4..585866f1 100644 --- a/subprojects/frontend/tsconfig.base.json +++ b/subprojects/frontend/tsconfig.base.json | |||
@@ -1,16 +1,7 @@ | |||
1 | { | 1 | { |
2 | "extends": "@tsconfig/node18-strictest-esm/tsconfig.json", | ||
2 | "compilerOptions": { | 3 | "compilerOptions": { |
3 | "target": "ESNext", | ||
4 | "module": "ESNext", | ||
5 | "moduleResolution": "Node", | ||
6 | "esModuleInterop": true, | ||
7 | "allowSyntheticDefaultImports": true, | ||
8 | "useDefineForClassFields": true, | 4 | "useDefineForClassFields": true, |
9 | "strict": true, | ||
10 | "noImplicitOverride": true, | ||
11 | "noImplicitReturns": true, | ||
12 | "exactOptionalPropertyTypes": true, | ||
13 | "isolatedModules": true, | 5 | "isolatedModules": true, |
14 | "skipLibCheck": true | ||
15 | } | 6 | } |
16 | } | 7 | } |
diff --git a/subprojects/frontend/tsconfig.json b/subprojects/frontend/tsconfig.json index e8053768..0dccec40 100644 --- a/subprojects/frontend/tsconfig.json +++ b/subprojects/frontend/tsconfig.json | |||
@@ -1,9 +1,9 @@ | |||
1 | { | 1 | { |
2 | "extends": "./tsconfig.base.json", | 2 | "extends": "./tsconfig.base.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "jsx": "react", | 4 | "jsx": "react-jsx", |
5 | "noEmit": true, | 5 | "noEmit": true, |
6 | "lib": ["DOM", "DOM.Iterable", "ESNext"], | 6 | "lib": ["DOM", "DOM.Iterable", "ES2022"], |
7 | "types": ["vite/client", "vite-plugin-pwa/client"] | 7 | "types": ["vite/client", "vite-plugin-pwa/client"] |
8 | }, | 8 | }, |
9 | "include": [ | 9 | "include": [ |
diff --git a/subprojects/frontend/tsconfig.node.json b/subprojects/frontend/tsconfig.node.json index f5d6e6ec..c4539dbc 100644 --- a/subprojects/frontend/tsconfig.node.json +++ b/subprojects/frontend/tsconfig.node.json | |||
@@ -2,8 +2,7 @@ | |||
2 | "extends": "./tsconfig.base.json", | 2 | "extends": "./tsconfig.base.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "composite": true, | 4 | "composite": true, |
5 | "checkJs": true, | 5 | "lib": ["ES2022"], |
6 | "lib": ["ESNext"], | ||
7 | "types": ["node"], | 6 | "types": ["node"], |
8 | "emitDeclarationOnly": true, | 7 | "emitDeclarationOnly": true, |
9 | "outDir": "build/typescript" | 8 | "outDir": "build/typescript" |
diff --git a/subprojects/frontend/vite.config.ts b/subprojects/frontend/vite.config.ts index 526ea541..2c810912 100644 --- a/subprojects/frontend/vite.config.ts +++ b/subprojects/frontend/vite.config.ts | |||
@@ -14,29 +14,29 @@ setDefaultResultOrder('verbatim'); | |||
14 | 14 | ||
15 | const thisDir = path.dirname(fileURLToPath(import.meta.url)); | 15 | const thisDir = path.dirname(fileURLToPath(import.meta.url)); |
16 | 16 | ||
17 | const mode = process.env.MODE || 'development'; | 17 | const mode = process.env['MODE'] || 'development'; |
18 | const isDevelopment = mode === 'development'; | 18 | const isDevelopment = mode === 'development'; |
19 | process.env.NODE_ENV ??= mode; | 19 | process.env['NODE_ENV'] ??= mode; |
20 | 20 | ||
21 | function portNumberOrElse(envName: string, fallback: number): number { | 21 | function portNumberOrElse(envName: string, fallback: number): number { |
22 | const value = process.env[envName]; | 22 | const value = process.env[envName]; |
23 | return value ? parseInt(value, 10) : fallback; | 23 | return value ? parseInt(value, 10) : fallback; |
24 | } | 24 | } |
25 | 25 | ||
26 | const listenHost = process.env.LISTEN_HOST || 'localhost'; | 26 | const listenHost = process.env['LISTEN_HOST'] || 'localhost'; |
27 | const listenPort = portNumberOrElse('LISTEN_PORT', 1313); | 27 | const listenPort = portNumberOrElse('LISTEN_PORT', 1313); |
28 | const apiHost = process.env.API_HOST || '127.0.0.1'; | 28 | const apiHost = process.env['API_HOST'] || '127.0.0.1'; |
29 | const apiPort = portNumberOrElse('API_PORT', 1312); | 29 | const apiPort = portNumberOrElse('API_PORT', 1312); |
30 | const apiSecure = apiPort === 443; | 30 | const apiSecure = apiPort === 443; |
31 | const publicHost = process.env.PUBLIC_HOST || listenHost; | 31 | const publicHost = process.env['PUBLIC_HOST'] || listenHost; |
32 | const publicPort = portNumberOrElse('PUBLIC_PORT', listenPort); | 32 | const publicPort = portNumberOrElse('PUBLIC_PORT', listenPort); |
33 | const publicSecure = publicPort === 443; | 33 | const publicSecure = publicPort === 443; |
34 | 34 | ||
35 | const { name: packageName, version: packageVersion } = JSON.parse( | 35 | const { name: packageName, version: packageVersion } = JSON.parse( |
36 | readFileSync(path.join(thisDir, 'package.json'), 'utf8'), | 36 | readFileSync(path.join(thisDir, 'package.json'), 'utf8'), |
37 | ) as { name: string; version: string }; | 37 | ) as { name: string; version: string }; |
38 | process.env.VITE_PACKAGE_NAME ??= packageName; | 38 | process.env['VITE_PACKAGE_NAME'] ??= packageName; |
39 | process.env.VITE_PACKAGE_VERSION ??= packageVersion; | 39 | process.env['VITE_PACKAGE_VERSION'] ??= packageVersion; |
40 | 40 | ||
41 | const minifyPlugin: PluginOption = { | 41 | const minifyPlugin: PluginOption = { |
42 | name: 'minify-html', | 42 | name: 'minify-html', |