Skip to content

Commit

Permalink
chore: update ts lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Oct 14, 2024
1 parent 66ebe80 commit a476e49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js-plugins/electron/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function farmElectronPlugin(
configureServer(server) {
isDev = true;

server.server?.once('listening', () => {
server.httpServer?.once('listening', () => {
// Used in electron/main.ts for during dev
process.env.FARM_DEV_SERVER_URL = resolveServerUrl(server);

Expand Down Expand Up @@ -163,7 +163,7 @@ function resolveFarmConfig(
}

function resolveServerUrl(server: Server) {
const addressInfo = server.server?.address();
const addressInfo = server.httpServer?.address();
const isAddressInfo = (x: any): x is AddressInfo => x?.address;

if (isAddressInfo(addressInfo)) {
Expand Down
5 changes: 2 additions & 3 deletions packages/runtime-plugin-hmr/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/**
* HMR client as a Farm Runtime Plugin
*/
import type { Plugin } from '@farmfe/runtime';
import { HmrClient } from './hmr-client';
import { createHotContext } from './hot-module-state';

let hmrClient: HmrClient;

export default {
name: 'farm-runtime-hmr-client-plugin',
bootstrap(moduleSystem) {
bootstrap(moduleSystem: any) {
hmrClient = new HmrClient(moduleSystem);
hmrClient.connect();
},
moduleCreated(module) {
moduleCreated(module: any) {
// create a hot context for each module
module.meta.hot = createHotContext(module.id, hmrClient);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/runtime-plugin-hmr/src/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ hue-6-2: #e6c07b
const errorAlert = (
message: string,
description: string,
type: string
_type: string
) => /*html*/ `
<div class="alert alert-error">
<span class="alert-icon">
Expand All @@ -425,7 +425,7 @@ const warnAlert = (description: string, type = 'warn') => /*html*/ `
`;

const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
// const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;

// Allow `ErrorOverlay` to extend `HTMLElement` even in environments where
// `HTMLElement` was not originally defined.
Expand Down Expand Up @@ -527,7 +527,7 @@ export class ErrorOverlay extends HTMLElement {
return hljs.highlightAuto(code).value;
}

renderMessages(messages: any[], links: boolean) {
renderMessages(messages: any[]) {
const messageContainer = this.root.querySelector('.message-container')!;
messageContainer.innerHTML = '';
if (typeof messages === 'string') {
Expand Down Expand Up @@ -570,7 +570,7 @@ export class ErrorOverlay extends HTMLElement {
return;
}

messages.forEach((msg, index) => {
messages.forEach((msg) => {
const messageElement = document.createElement('div');
messageElement.className = 'error-message';
msg = parseIfJSON(msg);
Expand Down

0 comments on commit a476e49

Please sign in to comment.