summaryrefslogtreecommitdiff
path: root/src/compiler/codegen.ts
diff options
context:
space:
mode:
authorGravatar duncanhealy <duncanhealy@users.noreply.github.com> 2021-04-12 16:20:58 +0100
committerGravatar GitHub <noreply@github.com> 2021-04-12 16:20:58 +0100
commit687ff5bacd8c776e514f53c4b59c3a67274d3971 (patch)
tree15e140d7d6c744c4b2096fea38d7f0e34fec8742 /src/compiler/codegen.ts
parentcffde0192bf9965e94a217fa0a44a86fbfa33337 (diff)
downloadastro-687ff5bacd8c776e514f53c4b59c3a67274d3971.tar.gz
astro-687ff5bacd8c776e514f53c4b59c3a67274d3971.tar.zst
astro-687ff5bacd8c776e514f53c4b59c3a67274d3971.zip
chore fix lint reduce errors generated (#83)
* add dep domhandler imported in in src/build/static * lint and jsDoc error * move domhandler to devDep * chore: add package lock * escape string jsDoc * chore: add astro dep in until prism import is refactored * chore: add snowpack example package lock
Diffstat (limited to 'src/compiler/codegen.ts')
-rw-r--r--src/compiler/codegen.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/codegen.ts b/src/compiler/codegen.ts
index be9493435..3e14ba069 100644
--- a/src/compiler/codegen.ts
+++ b/src/compiler/codegen.ts
@@ -381,9 +381,11 @@ function compileModule(module: Script, state: CodegenState, compileOptions: Comp
if (plugin) {
componentPlugins.add(plugin);
}
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
state.importExportStatements.add(module.content.slice(componentImport.start!, componentImport.end!));
}
for (const componentImport of componentExports) {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
state.importExportStatements.add(module.content.slice(componentImport.start!, componentImport.end!));
}
@@ -392,6 +394,7 @@ function compileModule(module: Script, state: CodegenState, compileOptions: Comp
for (const componentExport of componentProps) {
propsStatement += `${(componentExport.id as Identifier).name}`;
if (componentExport.init) {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
propsStatement += `= ${babelGenerator(componentExport.init!).code}`;
}
propsStatement += `,`;
@@ -482,7 +485,9 @@ function compileHtml(enterNode: TemplateNode, state: CodegenState, compileOption
switch (node.type) {
case 'Expression': {
let child = '';
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (node.children!.length) {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
child = compileHtml(node.children![0], state, compileOptions);
}
let raw = node.codeStart + child + node.codeEnd;