Skip to content

Commit e8496f9

Browse files
committed
improve type
1 parent f85e32b commit e8496f9

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/containers/ConverterLayout/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { EditorProps } from "@monaco-editor/react";
22

33
export const editorOptions: EditorProps["options"] = {
44
formatOnPaste: true,
5+
formatOnType: true,
56
stopRenderingLineAfter: -1,
67
minimap: { enabled: false },
78
stickyScroll: { enabled: false },

src/containers/Editor/components/TextEditor.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ loader.config({
1414
const editorOptions: EditorProps["options"] = {
1515
formatOnPaste: true,
1616
formatOnType: true,
17-
minimap: {
18-
enabled: false,
19-
},
17+
minimap: { enabled: false },
2018
scrollBeyondLastLine: false,
2119
};
2220

src/pages/tools/json-schema.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import { Box, Button, Container, Flex, Paper, Title, Text } from "@mantine/core";
3-
import { Editor } from "@monaco-editor/react";
3+
import { Editor, type OnMount } from "@monaco-editor/react";
44
import { JSONSchemaFaker } from "json-schema-faker";
55
import { LuCheck, LuXCircle } from "react-icons/lu";
66
import { editorOptions } from "src/containers/ConverterLayout/options";
@@ -10,7 +10,7 @@ import { generateType } from "src/lib/utils/generateType";
1010
import { jsonToContent } from "src/lib/utils/jsonAdapter";
1111

1212
const JSONSchemaTool = () => {
13-
const monacoRef = React.useRef<any>(null);
13+
const monacoRef = React.useRef<Parameters<OnMount>[1] | null>(null);
1414
const [jsonError, setJsonError] = React.useState(false);
1515
const [jsonSchemaError, setJsonSchemaError] = React.useState(false);
1616
const [json, setJson] = React.useState("");

0 commit comments

Comments
 (0)