Skip to content

Commit

Permalink
chore: reformat files
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jan 9, 2024
1 parent 987854f commit 69b3ff5
Show file tree
Hide file tree
Showing 296 changed files with 1,228 additions and 1,233 deletions.
8 changes: 8 additions & 0 deletions .changeset/lazy-worms-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@marko/translator-default": patch
"@marko/babel-utils": patch
"@marko/compiler": patch
"marko": patch
---

Upgrade all package deps to latest
62 changes: 31 additions & 31 deletions packages/babel-utils/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export interface TaglibLookup {
getTag(tagName: string): undefined | TagDefinition;
getAttribute(
tagName: string,
attrName: string
attrName: string,
): undefined | AttributeDefinition;
forEachAttribute(
tagName: string,
callback: (attr: AttributeDefinition, tag: TagDefinition) => void
callback: (attr: AttributeDefinition, tag: TagDefinition) => void,
): void;
}

Expand Down Expand Up @@ -143,7 +143,7 @@ export function defineTag<T extends Tag>(tag: T): T;

export type FunctionPlugin<T = any> = (
path: t.NodePath<T>,
types: typeof t
types: typeof t,
) => void;
type EnterExitPlugin<T = any> = {
enter?(path: t.NodePath<T>, types: typeof t): void;
Expand All @@ -161,7 +161,7 @@ export type Plugin<T = any> =

export function assertAllowedAttributes(
path: t.NodePath<t.MarkoTag>,
allowed: string[]
allowed: string[],
): void;
export function assertNoArgs(path: t.NodePath<t.MarkoTag>): void;
export function assertNoVar(path: t.NodePath<t.MarkoTag>): void;
Expand All @@ -180,31 +180,31 @@ export function registerMacro(path: t.NodePath<any>, name: string): void;
export function hasMacro(path: t.NodePath<any>, name: string): boolean;
export function getMacroIdentifierForName(
path: t.NodePath<any>,
name: string
name: string,
): t.Identifier;
export function getMacroIdentifier(path: t.NodePath<t.MarkoTag>): t.Identifier;
export function getTagDef(
path: t.NodePath<t.MarkoTag>
path: t.NodePath<t.MarkoTag>,
): TagDefinition | undefined;
export function getFullyResolvedTagName(path: t.NodePath<t.MarkoTag>): string;

export function findParentTag(
path: t.NodePath<t.MarkoTag>
path: t.NodePath<t.MarkoTag>,
): t.NodePath<t.MarkoTag> | undefined;
export function findAttributeTags(
path: t.NodePath<t.MarkoTag>
path: t.NodePath<t.MarkoTag>,
): Array<t.NodePath<t.MarkoTag>>;

export function getArgOrSequence(
path: t.NodePath<t.MarkoTag | t.MarkoAttribute>
path: t.NodePath<t.MarkoTag | t.MarkoAttribute>,
): t.Expression;

export function loadFileForTag(
path: t.NodePath<t.MarkoTag>
path: t.NodePath<t.MarkoTag>,
): t.BabelFile | undefined;
export function loadFileForImport(
file: t.BabelFile,
template: string
template: string,
): t.BabelFile | undefined;

export function normalizeTemplateString(
Expand All @@ -219,13 +219,13 @@ export function getLoc(file: t.BabelFile, pos: number): Loc;
export function getLocRange(
file: t.BabelFile,
start: number,
end: number
end: number,
): LocRange;
export function withLoc<T extends t.Node>(
file: t.BabelFile,
node: T,
start: number,
end: number
end: number,
): T;

export function parseStatements(file: t.BabelFile, str: string): t.Statement[];
Expand All @@ -234,7 +234,7 @@ export function parseStatements(
str: string,
sourceStart: number,
sourceEnd: number,
sourceOffset?: number
sourceOffset?: number,
): t.Statement[];

export function parseExpression(file: t.BabelFile, str: string): t.Expression;
Expand All @@ -243,76 +243,76 @@ export function parseExpression(
str: string,
sourceStart: number,
sourceEnd: number,
sourceOffset?: number
sourceOffset?: number,
): t.Expression;

export function parseParams(
file: t.BabelFile,
str: string
str: string,
): t.Function["params"];
export function parseParams(
file: t.BabelFile,
str: string,
sourceStart: number,
sourceEnd: number
sourceEnd: number,
): t.Function["params"];

export function parseArgs(
file: t.BabelFile,
str: string
str: string,
): t.CallExpression["arguments"];
export function parseArgs(
file: t.BabelFile,
str: string,
sourceStart: number,
sourceEnd: number
sourceEnd: number,
): t.CallExpression["arguments"];

export function parseVar(
file: t.BabelFile,
str: string
str: string,
): t.VariableDeclarator["id"];
export function parseVar(
file: t.BabelFile,
str: string,
sourceStart: number,
sourceEnd: number
sourceEnd: number,
): t.VariableDeclarator["id"];

export function parseTemplateLiteral(
file: t.BabelFile,
str: string
str: string,
): t.TemplateLiteral;
export function parseTemplateLiteral(
file: t.BabelFile,
str: string,
sourceStart: number,
sourceEnd: number
sourceEnd: number,
): t.TemplateLiteral;

export function resolveRelativePath(file: t.BabelFile, request: string): string;
export function importDefault(
file: t.BabelFile,
request: string,
nameHint?: string
nameHint?: string,
): t.Identifier;
export function importNamed(
file: t.BabelFile,
request: string,
name: string,
nameHint?: string
nameHint?: string,
): t.Identifier;

export function getTaglibLookup(file: t.BabelFile): TaglibLookup;
export function getTagDefForTagName(
file: t.BabelFile,
tagName: string
tagName: string,
): TagDefinition | undefined;

export function getTemplateId(optimize: boolean, request: string): string;
export function resolveTagImport(
path: t.NodePath<any>,
request: string
request: string,
): string | undefined;

export enum DiagnosticType {
Expand Down Expand Up @@ -345,19 +345,19 @@ export interface DiagnosticOptions {

export function diagnosticError(
path: t.NodePath<any>,
options: DiagnosticOptions
options: DiagnosticOptions,
): void;
export function diagnosticWarn(
path: t.NodePath<any>,
options: DiagnosticOptions
options: DiagnosticOptions,
): void;
export function diagnosticDeprecate(
path: t.NodePath<any>,
options: DiagnosticOptions
options: DiagnosticOptions,
): void;
export function diagnosticSuggest(
path: t.NodePath<any>,
options: DiagnosticOptions
options: DiagnosticOptions,
): void;

interface ConfirmFix {
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-utils/src/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function assertAllowedAttributes(path, allowed) {
throw path
.get(`attributes.${i}`)
.buildCodeFrameError(
`Invalid "${node.name.value}" tag attribute: "${attr.name}".`
`Invalid "${node.name.value}" tag attribute: "${attr.name}".`,
);
}
});
Expand All @@ -22,7 +22,7 @@ export function assertNoParams(path) {
const end = params[params.length - 1].loc.end;
throw path.hub.buildError(
{ loc: { start, end } },
"Tag does not support parameters."
"Tag does not support parameters.",
);
}
}
Expand All @@ -44,7 +44,7 @@ export function assertNoArgs(path) {
const end = args[args.length - 1].node.loc.end;
throw hub.buildError(
{ loc: { start, end } },
"Tag does not support arguments."
"Tag does not support arguments.",
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-utils/src/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function add(type, path, options) {
if (rawFix) {
if (file.___compileStage !== "migrate") {
throw new Error(
"Diagnostic fixes can only be registered during the migrate stage."
"Diagnostic fixes can only be registered during the migrate stage.",
);
}

Expand Down
18 changes: 9 additions & 9 deletions packages/babel-utils/src/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function resolveRelativePath(file, request) {
if (file.markoOpts.optimize) {
request = request.replace(
/(^|\/node-modules\/)marko\/src\//,
"$1marko/dist/"
"$1marko/dist/",
);
}

Expand All @@ -30,8 +30,8 @@ export function importDefault(file, request, nameHint) {
request,
(importDeclaration = file.path.pushContainer(
"body",
t.importDeclaration([], t.stringLiteral(request))
)[0])
t.importDeclaration([], t.stringLiteral(request)),
)[0]),
);
}

Expand All @@ -41,14 +41,14 @@ export function importDefault(file, request, nameHint) {

const specifiers = importDeclaration.get("specifiers");
const specifier = specifiers.find((specifier) =>
specifier.isImportDefaultSpecifier()
specifier.isImportDefaultSpecifier(),
);

if (!specifier) {
const identifier = file.scope.generateUidIdentifier(nameHint);
importDeclaration.pushContainer(
"specifiers",
t.importDefaultSpecifier(identifier)
t.importDefaultSpecifier(identifier),
);
return identifier;
}
Expand All @@ -66,22 +66,22 @@ export function importNamed(file, request, name, nameHint = name) {
request,
(importDeclaration = file.path.pushContainer(
"body",
t.importDeclaration([], t.stringLiteral(request))
)[0])
t.importDeclaration([], t.stringLiteral(request)),
)[0]),
);
}

const specifiers = importDeclaration.get("specifiers");
const specifier = specifiers.find(
(specifier) =>
specifier.isImportSpecifier() && specifier.node.imported.name === name
specifier.isImportSpecifier() && specifier.node.imported.name === name,
);

if (!specifier) {
const identifier = file.scope.generateUidIdentifier(nameHint);
importDeclaration.pushContainer(
"specifiers",
t.importSpecifier(identifier, t.identifier(name))
t.importSpecifier(identifier, t.identifier(name)),
);
return identifier;
}
Expand Down
Loading

0 comments on commit 69b3ff5

Please sign in to comment.