summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintignore1
-rw-r--r--.eslintrc.cjs1
-rw-r--r--src/@types/micromark-extension-gfm.d.ts3
-rw-r--r--src/transform2.ts5
4 files changed, 6 insertions, 4 deletions
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 000000000..d6a8d8039
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+src/compiler.js
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 15cc40908..8cdfdc2f3 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 000000000..ebdfe3b3a
--- /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 ab516deac..94cd02fa2 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, string>): 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) {