diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..d6a8d8039e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/compiler.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 15cc409087..8cdfdc2f38 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,5 +9,6 @@ module.exports = { '@typescript-eslint/no-var-requires': 'off', 'prettier/prettier': 'error', 'prefer-const': 'off', + 'prefer-rest-params': 'off', }, }; diff --git a/src/@types/micromark-extension-gfm.d.ts b/src/@types/micromark-extension-gfm.d.ts new file mode 100644 index 0000000000..ebdfe3b3a0 --- /dev/null +++ b/src/@types/micromark-extension-gfm.d.ts @@ -0,0 +1,3 @@ +// TODO: add types (if helpful) +declare module 'micromark-extension-gfm'; +declare module 'micromark-extension-gfm/html.js'; diff --git a/src/transform2.ts b/src/transform2.ts index ab516deacf..94cd02fa2f 100644 --- a/src/transform2.ts +++ b/src/transform2.ts @@ -7,7 +7,6 @@ import eslexer from 'es-module-lexer'; import micromark from 'micromark'; import gfmSyntax from 'micromark-extension-gfm'; import matter from 'gray-matter'; -// @ts-ignore import gfmHtml from 'micromark-extension-gfm/html.js'; import { walk, parse } from './compiler.js'; import markdownEncode from './markdown-encode.js'; @@ -90,7 +89,7 @@ function getTextFromAttribute(attr: any): string { } function generateAttributes(attrs: Record): string { - let result: string = '{'; + let result = '{'; for (const [key, val] of Object.entries(attrs)) { result += JSON.stringify(key) + ':' + val + ','; } @@ -222,7 +221,6 @@ async function convertHmxToJsx(template: string, compileOptions: CompileOptions) let currentDepth = 0; walk(ast.html as any, { - // @ts-ignore enter(node: TemplateNode, parent, prop, index) { // console.log("enter", node.type); switch (node.type) { @@ -331,7 +329,6 @@ async function convertHmxToJsx(template: string, compileOptions: CompileOptions) throw new Error('Unexpected node type: ' + node.type); } }, - // @ts-ignore leave(node: TemplateNode, parent, prop, index) { // console.log("leave", node.type); switch (node.type) {