[ci] npm run format

This commit is contained in:
matthewp 2021-04-09 18:09:44 +00:00 committed by GitHub Actions
parent ad9c3b1d8d
commit 62924b3162
5 changed files with 44 additions and 47 deletions

View file

@ -65,8 +65,8 @@ export default function (module: Script): Transformer {
type: 'Expression',
codeStart: '`' + escape(code) + '`',
codeEnd: '',
children: []
}
children: [],
},
},
],
},

View file

@ -1,4 +1,3 @@
import type { BaseNode, Expression } from '../../interfaces';
import { Parser } from '../index.js';
import parseAstro from '../index.js';
@ -69,9 +68,7 @@ function consume_line_comment(state: ParseState) {
} while (in_bounds(state));
}
const voidElements = new Set(['area', 'base', 'br', 'col', 'command', 'embed',
'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source',
'track', 'wbr']);
const voidElements = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
function consume_tag(state: ParseState) {
const start = state.index - 1;
@ -86,7 +83,7 @@ function consume_tag(state: ParseState) {
const char = next_char(state);
switch (char) {
case '\'':
case "'":
case '"': {
consume_string(state, char);
break;
@ -160,7 +157,6 @@ function consume_tag(state: ParseState) {
const source = state.source.substring(start, state.index);
const ast = parseAstro(source);
const fragment = ast.html;
@ -174,15 +170,17 @@ function consume_expression(source: string, start: number): Expression {
end: Number.NaN,
codeStart: '',
codeEnd: '',
children: []
children: [],
};
let codeEndStart: number = 0;
const state: ParseState = {
source, start, index: start,
source,
start,
index: start,
curlyCount: 1,
bracketCount: 0,
root: expr
root: expr,
};
do {
@ -204,7 +202,7 @@ function consume_expression(source: string, start: number): Expression {
codeEndStart = state.index;
break;
}
case '\'':
case "'":
case '"':
case '`': {
consume_string(state, char);

View file

@ -4,7 +4,6 @@ import type { Node } from 'estree';
import { Parser } from '../index.js';
import { Script } from '../../interfaces.js';
const script_closing_tag = '</script>';
function get_context(parser: Parser, attributes: any[], start: number): 'runtime' | 'setup' {