diff --git a/libs/jast/jast/src/lib/names.ts b/libs/jast/jast/src/lib/names.ts index db3763b5..536ca511 100755 --- a/libs/jast/jast/src/lib/names.ts +++ b/libs/jast/jast/src/lib/names.ts @@ -312,4 +312,6 @@ export const names = [ 'year', ] -function ignore() {} +function ignore() { + // +} diff --git a/libs/jast/jast/src/lib/rejour.ts b/libs/jast/jast/src/lib/rejour.ts index 902d7312..52f49006 100755 --- a/libs/jast/jast/src/lib/rejour.ts +++ b/libs/jast/jast/src/lib/rejour.ts @@ -33,7 +33,7 @@ export interface Element extends UnistNode { } export function isElement(node: UnistNode): node is Element { - return node.hasOwnProperty('name') && node.hasOwnProperty('attributes') + return 'name' in node && 'attributes' in node } export function isParagraphContent(node: UnistNode): node is P['children'][number] { diff --git a/libs/rejour/rejour-parse/src/lib/rejour-parse.spec.ts b/libs/rejour/rejour-parse/src/lib/rejour-parse.spec.ts index c1fc3518..27d46cd5 100755 --- a/libs/rejour/rejour-parse/src/lib/rejour-parse.spec.ts +++ b/libs/rejour/rejour-parse/src/lib/rejour-parse.spec.ts @@ -1,5 +1,5 @@ import { unified } from 'unified' -import rejourParse from './rejour-parse' +import rejourParse from './rejour-parse.js' import { removePosition } from 'unist-util-remove-position' describe('parser', () => { @@ -26,7 +26,7 @@ describe('parser', () => { `), - true + true, ) console.dir(tree, { depth: null }) expect(tree).toEqual({ @@ -48,7 +48,7 @@ describe('parser', () => { `), - true + true, ) console.dir(tree, { depth: null }) expect(tree).toEqual({ diff --git a/libs/texast/texast-util-to-latex/src/lib/configure.ts b/libs/texast/texast-util-to-latex/src/lib/configure.ts index cf5222a1..56b7b111 100755 --- a/libs/texast/texast-util-to-latex/src/lib/configure.ts +++ b/libs/texast/texast-util-to-latex/src/lib/configure.ts @@ -1,4 +1,4 @@ -import { Options, Context } from './types' +import { Options, Context } from './types.js' export function configure(base: Context, extension: Options): Context { let index = -1 diff --git a/libs/texast/texast-util-to-latex/src/lib/handle/alignment-tab.ts b/libs/texast/texast-util-to-latex/src/lib/handle/alignment-tab.ts index c765dd8e..4505bfd9 100755 --- a/libs/texast/texast-util-to-latex/src/lib/handle/alignment-tab.ts +++ b/libs/texast/texast-util-to-latex/src/lib/handle/alignment-tab.ts @@ -1,9 +1,6 @@ import { AlignmentTab } from 'texast' -import { BasicHandle, Options } from '../types' +import { BasicHandle, Options } from '../types.js' -export const alignmentTab: BasicHandle = ( - node: AlignmentTab, - options: Options = {} -) => { +export const alignmentTab: BasicHandle = (node: AlignmentTab, options: Options = {}) => { return ' & ' } diff --git a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.ts b/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.ts index b67ca946..58e09c99 100755 --- a/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.ts +++ b/libs/texast/texast-util-to-latex/src/lib/texast-util-to-latex.ts @@ -1,7 +1,5 @@ -import { handle } from './handle' -import { zwitch } from 'zwitch' -import { configure } from './configure' -import { Options, Context, Node, Handle, Join, Unsafe } from './types' +import { handle } from './handle/index.js' +import { Options, Node } from './types.js' import { isKnownNode } from 'texast' const invalid = (value: unknown) => { @@ -11,11 +9,7 @@ const unknown = (node: Node) => { throw new Error(`Unknown type ${node.type}, skipping...`) } -const handleNodeProperly = ( - type: string, - node: Node, - options: Options = {} -) => { +const handleNodeProperly = (type: string, node: Node, options: Options = {}) => { // @ts-expect-error No it's fine we can throw everything into it const handleFunction = handle?.[type] diff --git a/libs/texast/texast-util-to-latex/src/lib/util/safe.ts b/libs/texast/texast-util-to-latex/src/lib/util/safe.ts index b09ab010..6f65b02b 100755 --- a/libs/texast/texast-util-to-latex/src/lib/util/safe.ts +++ b/libs/texast/texast-util-to-latex/src/lib/util/safe.ts @@ -1,4 +1,4 @@ -import { Context, SafeOptions } from '../types' +import { Context, SafeOptions } from '../types.js' /** * @param {Context} context @@ -9,7 +9,7 @@ import { Context, SafeOptions } from '../types' export function safe( context: Context, input: string | null | undefined, - config: SafeOptions & { encode?: Array } + config: SafeOptions & { encode?: Array }, ): string { return input || '' }