diff --git a/.eslintrc.js b/.eslintrc.js index 55f5982..886d7a1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,6 @@ module.exports = { '@typescript-eslint/consistent-type-assertions': 'off', '@typescript-eslint/consistent-type-definitions': 'off', '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/member-delimiter-style': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/prefer-optional-chain': 'off', '@typescript-eslint/prefer-includes': 'off', diff --git a/src/hooks.ts b/src/hooks.ts index a891b3c..5ca8a01 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -12,14 +12,14 @@ export type RemoveHook = (vNode: VNode, removeCallback: () => void) => any; export type PostHook = () => any; export interface Hooks { - pre?: PreHook; - init?: InitHook; - create?: CreateHook; - insert?: InsertHook; - prepatch?: PrePatchHook; - update?: UpdateHook; - postpatch?: PostPatchHook; - destroy?: DestroyHook; - remove?: RemoveHook; - post?: PostHook; + pre?: PreHook + init?: InitHook + create?: CreateHook + insert?: InsertHook + prepatch?: PrePatchHook + update?: UpdateHook + postpatch?: PostPatchHook + destroy?: DestroyHook + remove?: RemoveHook + post?: PostHook } diff --git a/src/htmldomapi.ts b/src/htmldomapi.ts index ce937e7..9ebb2cd 100644 --- a/src/htmldomapi.ts +++ b/src/htmldomapi.ts @@ -1,19 +1,19 @@ export interface DOMAPI { - createElement: (tagName: any) => HTMLElement; - createElementNS: (namespaceURI: string, qualifiedName: string) => Element; - createTextNode: (text: string) => Text; - createComment: (text: string) => Comment; - insertBefore: (parentNode: Node, newNode: Node, referenceNode: Node | null) => void; - removeChild: (node: Node, child: Node) => void; - appendChild: (node: Node, child: Node) => void; - parentNode: (node: Node) => Node; - nextSibling: (node: Node) => Node; - tagName: (elm: Element) => string; - setTextContent: (node: Node, text: string | null) => void; - getTextContent: (node: Node) => string | null; - isElement: (node: Node) => node is Element; - isText: (node: Node) => node is Text; - isComment: (node: Node) => node is Comment; + createElement: (tagName: any) => HTMLElement + createElementNS: (namespaceURI: string, qualifiedName: string) => Element + createTextNode: (text: string) => Text + createComment: (text: string) => Comment + insertBefore: (parentNode: Node, newNode: Node, referenceNode: Node | null) => void + removeChild: (node: Node, child: Node) => void + appendChild: (node: Node, child: Node) => void + parentNode: (node: Node) => Node + nextSibling: (node: Node) => Node + tagName: (elm: Element) => string + setTextContent: (node: Node, text: string | null) => void + getTextContent: (node: Node) => string | null + isElement: (node: Node) => node is Element + isText: (node: Node) => node is Text + isComment: (node: Node) => node is Comment } function createElement (tagName: any): HTMLElement { diff --git a/src/jsx-global.ts b/src/jsx-global.ts index 0b85139..ecc85b6 100644 --- a/src/jsx-global.ts +++ b/src/jsx-global.ts @@ -14,7 +14,7 @@ declare global { namespace JSX { type Element = VNode; interface IntrinsicElements { - [elemName: string]: VNodeData; + [elemName: string]: VNodeData } } } diff --git a/src/modules/attributes.ts b/src/modules/attributes.ts index 2135cd5..4b7f4aa 100755 --- a/src/modules/attributes.ts +++ b/src/modules/attributes.ts @@ -4,8 +4,8 @@ import { Module } from './module'; // because those in TypeScript are too restrictive: https://github.com/Microsoft/TSJS-lib-generator/pull/237 declare global { interface Element { - setAttribute(name: string, value: string | number | boolean): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | number | boolean): void; + setAttribute(name: string, value: string | number | boolean): void + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string | number | boolean): void } } diff --git a/src/modules/module.ts b/src/modules/module.ts index 7ba6fb9..33828c8 100644 --- a/src/modules/module.ts +++ b/src/modules/module.ts @@ -1,10 +1,10 @@ import { PreHook, CreateHook, UpdateHook, DestroyHook, RemoveHook, PostHook } from '../hooks'; export interface Module { - pre: PreHook; - create: CreateHook; - update: UpdateHook; - destroy: DestroyHook; - remove: RemoveHook; - post: PostHook; + pre: PreHook + create: CreateHook + update: UpdateHook + destroy: DestroyHook + remove: RemoveHook + post: PostHook } diff --git a/src/thunk.ts b/src/thunk.ts index f678f0f..f3be906 100644 --- a/src/thunk.ts +++ b/src/thunk.ts @@ -2,17 +2,17 @@ import { VNode, VNodeData } from './vnode'; import { h } from './h'; export interface ThunkData extends VNodeData { - fn: () => VNode; - args: any[]; + fn: () => VNode + args: any[] } export interface Thunk extends VNode { - data: ThunkData; + data: ThunkData } export interface ThunkFn { - (sel: string, fn: Function, args: any[]): Thunk; - (sel: string, key: any, fn: Function, args: any[]): Thunk; + (sel: string, fn: Function, args: any[]): Thunk + (sel: string, key: any, fn: Function, args: any[]): Thunk } function copyToThunk (vnode: VNode, thunk: VNode): void { diff --git a/src/vnode.ts b/src/vnode.ts index 7550f2c..71ea13a 100644 --- a/src/vnode.ts +++ b/src/vnode.ts @@ -11,29 +11,29 @@ import { Hero } from './modules/hero'; export type Key = string | number; export interface VNode { - sel: string | undefined; - data: VNodeData | undefined; - children: Array | undefined; - elm: Node | undefined; - text: string | undefined; - key: Key | undefined; + sel: string | undefined + data: VNodeData | undefined + children: Array | undefined + elm: Node | undefined + text: string | undefined + key: Key | undefined } export interface VNodeData { - props?: Props; - attrs?: Attrs; - class?: Classes; - style?: VNodeStyle; - dataset?: Dataset; - on?: On; - hero?: Hero; - attachData?: AttachData; - hook?: Hooks; - key?: Key; - ns?: string; // for SVGs - fn?: () => VNode; // for thunks - args?: any[]; // for thunks - [key: string]: any; // for any other 3rd party module + props?: Props + attrs?: Attrs + class?: Classes + style?: VNodeStyle + dataset?: Dataset + on?: On + hero?: Hero + attachData?: AttachData + hook?: Hooks + key?: Key + ns?: string // for SVGs + fn?: () => VNode // for thunks + args?: any[] // for thunks + [key: string]: any // for any other 3rd party module } export function vnode (sel: string | undefined,