diff --git a/.eslintrc.js b/.eslintrc.js index 2b9c136c0..3d62910a3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -61,7 +61,7 @@ module.exports = { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-parameter-properties": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-use-before-define": "off", diff --git a/lean4-infoview/src/infoview/messages.tsx b/lean4-infoview/src/infoview/messages.tsx index 97fa034a2..398153302 100644 --- a/lean4-infoview/src/infoview/messages.tsx +++ b/lean4-infoview/src/infoview/messages.tsx @@ -175,8 +175,8 @@ function AllMessagesBody({uri, messages, setNumDiags}: AllMessagesBodyProps) { setNumDiags(msgs.length) } void fn() - }, [messages]) - React.useEffect(() => () => /* Called on unmount. */ setNumDiags(undefined), []) + }, [messages, setNumDiags]) + React.useEffect(() => () => /* Called on unmount. */ setNumDiags(undefined), [setNumDiags]) if (msgs === undefined) return <>Loading messages... else return } diff --git a/vscode-lean4/src/utils/converters.ts b/vscode-lean4/src/utils/converters.ts index 89a7693ac..6fd575028 100644 --- a/vscode-lean4/src/utils/converters.ts +++ b/vscode-lean4/src/utils/converters.ts @@ -55,7 +55,7 @@ export function patchConverters(p2cConverter: Protocol2CodeConverter, c2pConvert // The original definition refers to `asDiagnostic` as a local function // rather than as a member of `Protocol2CodeConverter`, // so we need to overwrite it, too. - p2cConverter.asDiagnostics = async (diags, token) => async.map(diags, p2cConverter.asDiagnostic, token) + p2cConverter.asDiagnostics = async (diags, token) => async.map(diags, d => p2cConverter.asDiagnostic(d), token) // eslint-disable-next-line @typescript-eslint/unbound-method const oldC2pAsDiagnostic = c2pConverter.asDiagnostic @@ -64,8 +64,9 @@ export function patchConverters(p2cConverter: Protocol2CodeConverter, c2pConvert protDiag.fullRange = c2pConverter.asRange(diag.fullRange) return protDiag } - c2pConverter.asDiagnostics = async (diags, token) => async.map(diags, c2pConverter.asDiagnostic, token) + c2pConverter.asDiagnostics = async (diags, token) => async.map(diags, d => c2pConverter.asDiagnostic(d), token) + // eslint-disable-next-line @typescript-eslint/unbound-method const oldP2CAsWorkspaceEdit = p2cConverter.asWorkspaceEdit p2cConverter.asWorkspaceEdit = async function (item: ls.WorkspaceEdit | null | undefined, token?: code.CancellationToken) { if (item === undefined || item === null) return undefined @@ -104,6 +105,7 @@ export function patchConverters(p2cConverter: Protocol2CodeConverter, c2pConvert return oldP2CAsWorkspaceEdit.apply(this, [item, token]) } + // eslint-disable-next-line @typescript-eslint/unbound-method const oldP2cAsCodeAction = p2cConverter.asCodeAction p2cConverter.asCodeAction = async function (item: ls.CodeAction | null | undefined, token?: code.CancellationToken) { // if (item.diagnostics !== undefined) { result.diagnostics = asDiagnosticsSync(item.diagnostics); }