Skip to content

Commit

Permalink
Add strict check to tsconfig and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Sep 26, 2023
1 parent 7d03ce4 commit 2c695b6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ let FrameView = ({
frame: MFrame<CharRange>;
}) => {
let code = useContext(CodeContext);
let snippet = codeRange(code, frame.location);
let snippet = codeRange(code!, frame.location);
return (
<div className="frame">
<Header className="frame-header">{frame.name}</Header>
Expand Down Expand Up @@ -814,14 +814,14 @@ export function renderInterpreter(
) {
let root = ReactDOM.createRoot(container);
let marks = annotations?.state_locations || [];
let widgetRanges: number[];
let widgetRanges;
if (marks.length > 0) {
let [sortedMarks, filteredSteps] = filterSteps(view, trace.steps, marks);
widgetRanges = sortedMarks;
trace.steps = filteredSteps;
} else {
widgetRanges = trace.steps.map(
step => linecolToPosition(_.last(step.stack.frames)!.location.end, view.state.doc)
widgetRanges = trace.steps.map(step =>
linecolToPosition(_.last(step.stack.frames)!.location.end, view.state.doc)
);
}

Expand Down
2 changes: 2 additions & 0 deletions frontend/packages/aquascope-embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"@codemirror/view": "^6.4.0",
"@floating-ui/react-dom": "^1.3.0",
"@lezer/highlight": "^1.1.3",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.2.0",
"@vitejs/plugin-react": "^4.0.3",
"aquascope-editor": "workspace:*",
"puppeteer": "^19.6.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/aquascope-embed/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let BugReporter = () => (
<ContextProvider title={"Report a bug"} buttonText={"🐞"}>
{close => {
let code = useContext(CodeContext);
let onSubmit: React.FormEventHandler<HTMLFormElement> = event => {
let onSubmit: React.FormEventHandler<HTMLFormElement> = (event: any) => {
let data = new FormData(event.target as any);
let feedback = data.get("feedback")!.toString();
window.telemetry!.log("aquascopeBug", { code, feedback });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from "vitest";

const permStackSelector = ".permission-stack";
const permStepSelector = ".step-widget-container";
const interpSelector = ".interpreter";
const _interpSelector = ".interpreter";

describe("Aquascope Standalone", () => {
let browser: Browser;
Expand Down
54 changes: 15 additions & 39 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"declaration": true,
"jsx": "react",
"esModuleInterop": true,
"allowJs": true
"allowJs": true,
"strict": true
}
}
}

0 comments on commit 2c695b6

Please sign in to comment.