chore: sort imports

This commit is contained in:
Michael Rawlings 2023-07-07 12:41:14 -04:00
parent dacbaa72e1
commit 067db9883f
25 changed files with 60 additions and 49 deletions

View File

@ -1,7 +1,9 @@
{
"root": true,
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"sourceType": "module",
"impliedStrict": true,
"ecmaFeatures": {
"jsx": false
}
@ -14,5 +16,14 @@
"mocha": true,
"es2020": true,
"browser": true
},
"rules": {
"sort-imports": [
"error",
{
"allowSeparatedGroups": true,
"ignoreDeclarationSort": true
}
]
}
}

View File

@ -1,4 +1,4 @@
import { relative, resolve, basename, dirname } from "path";
import { basename, dirname, relative, resolve } from "path";
import resolveFrom from "resolve-from";
import { createHash } from "crypto";
import { types as t } from "@marko/compiler";

View File

@ -1,13 +1,13 @@
import { createParser, TagType } from "htmljs-parser";
import { TagType, createParser } from "htmljs-parser";
import * as t from "../babel-types";
import {
parseStatements,
parseExpression,
parseArgs,
parseParams,
parseVar,
parseTemplateLiteral,
getTagDefForTagName,
parseArgs,
parseExpression,
parseParams,
parseStatements,
parseTemplateLiteral,
parseVar,
} from "@marko/babel-utils";
const noop = () => {};

View File

@ -2,7 +2,7 @@ import "../types/patch";
import * as t from "@babel/types";
import traverse, { NodePath, Scope } from "@babel/traverse";
import { MARKO_TYPES, MARKO_ALIAS_TYPES } from "../types/definitions";
import { MARKO_ALIAS_TYPES, MARKO_TYPES } from "../types/definitions";
MARKO_TYPES.forEach((typeName) => {
const checkKey = `is${typeName}`;

View File

@ -1,9 +1,9 @@
import {
arrayOfType,
assertEach,
assertNodeType,
assertValueType,
arrayOfType,
chain,
assertEach,
} from "@babel/types/lib/definitions/utils";
const valueFieldCommon = {

View File

@ -4,7 +4,7 @@ import defineType from "@babel/types/lib/definitions/utils";
import validate from "@babel/types/lib/validators/validate";
import * as generatedValidators from "@babel/types/lib/validators/generated";
import * as referencedValidators from "@babel/types/lib/validators/isReferenced";
import definitions, { MARKO_TYPES, MARKO_ALIAS_TYPES } from "./definitions";
import definitions, { MARKO_ALIAS_TYPES, MARKO_TYPES } from "./definitions";
const {
TYPES,

View File

@ -1,19 +1,19 @@
import { resolve } from "path";
import { types as t } from "@marko/compiler";
import {
parseExpression,
resolveTagImport,
resolveRelativePath,
importNamed,
importDefault,
parseStatements,
isNativeTag,
isMacroTag,
isDynamicTag,
isAttributeTag,
loadFileForTag,
findParentTag,
getTagDef,
importDefault,
importNamed,
isAttributeTag,
isDynamicTag,
isMacroTag,
isNativeTag,
loadFileForTag,
parseExpression,
parseStatements,
resolveRelativePath,
resolveTagImport,
} from "@marko/babel-utils";
import { version } from "marko/package.json";
import MarkoDocumentType from "./document-type";

View File

@ -1,5 +1,5 @@
import { types as t } from "@marko/compiler";
import { getTagDef, importNamed, importDefault } from "@marko/babel-utils";
import { getTagDef, importDefault, importNamed } from "@marko/babel-utils";
import toString from "marko/src/runtime/helpers/to-string";
import { x as escapeXML } from "marko/src/runtime/html/helpers/escape-xml";
import escapeScript from "marko/src/runtime/html/helpers/escape-script-placeholder";

View File

@ -1,11 +1,11 @@
import { types as t } from "@marko/compiler";
import {
findParentTag,
assertNoArgs,
findParentTag,
getTagDef,
isTransparentTag,
isAttributeTag,
importDefault,
isAttributeTag,
isTransparentTag,
} from "@marko/babel-utils";
import { getAttrs } from "./util";
import withPreviousLocation from "../util/with-previous-location";

View File

@ -1,5 +1,5 @@
import { types as t } from "@marko/compiler";
import { isNativeTag, importDefault } from "@marko/babel-utils";
import { importDefault, isNativeTag } from "@marko/babel-utils";
import classToString from "marko/src/runtime/helpers/class-value";
import withPreviousLocation from "../../../util/with-previous-location";

View File

@ -1,5 +1,5 @@
import { types as t } from "@marko/compiler";
import { normalizeTemplateString, isNativeTag } from "@marko/babel-utils";
import { isNativeTag, normalizeTemplateString } from "@marko/babel-utils";
const EMPTY_OBJECT = {};
export default {

View File

@ -1,5 +1,5 @@
import { types as t } from "@marko/compiler";
import { isNativeTag, importDefault } from "@marko/babel-utils";
import { importDefault, isNativeTag } from "@marko/babel-utils";
import styleToString from "marko/src/runtime/helpers/style-value";
import withPreviousLocation from "../../../util/with-previous-location";

View File

@ -1,4 +1,4 @@
import { isNativeTag, getTagDef, importDefault } from "@marko/babel-utils";
import { getTagDef, importDefault, isNativeTag } from "@marko/babel-utils";
import directives from "./directives";
import modifiers from "./modifiers";

View File

@ -5,7 +5,7 @@ import {
importDefault,
resolveRelativePath,
} from "@marko/babel-utils";
import { getAttrs, buildEventHandlerArray } from "./util";
import { buildEventHandlerArray, getAttrs } from "./util";
import nativeTag from "./native-tag";
import dynamicTag from "./dynamic-tag";
import withPreviousLocation from "../util/with-previous-location";

View File

@ -1,6 +1,6 @@
import { types as t } from "@marko/compiler";
import { importDefault } from "@marko/babel-utils";
import { getAttrs, buildEventHandlerArray } from "./util";
import { buildEventHandlerArray, getAttrs } from "./util";
import withPreviousLocation from "../util/with-previous-location";
export default function (path) {

View File

@ -1,13 +1,13 @@
import nodePath from "path";
import { types as t } from "@marko/compiler";
import {
assertNoVar,
findAttributeTags,
getTagDef,
isDynamicTag,
isAttributeTag,
isDynamicTag,
isMacroTag,
isNativeTag,
findAttributeTags,
assertNoVar,
} from "@marko/babel-utils";
import nativeTag from "./native-tag";
import dynamicTag from "./dynamic-tag";

View File

@ -1,9 +1,9 @@
import nativeTagHtml from "./native-tag[html]";
import nativeTagVdom from "./native-tag[vdom]";
import {
assertNoArgs,
assertNoAttributeTags,
assertNoParams,
assertNoArgs,
} from "@marko/babel-utils";
export default function (path, isNullable) {

View File

@ -1,5 +1,5 @@
import { types as t } from "@marko/compiler";
import { normalizeTemplateString, importDefault } from "@marko/babel-utils";
import { importDefault, normalizeTemplateString } from "@marko/babel-utils";
import attrHelper from "marko/src/runtime/html/helpers/attr";
import { evaluateAttr } from "../util";

View File

@ -3,8 +3,8 @@ import SELF_CLOSING from "self-closing-tags";
import { types as t } from "@marko/compiler";
import {
getTagDef,
normalizeTemplateString,
importDefault,
normalizeTemplateString,
} from "@marko/babel-utils";
import write from "../../util/html-out-write";
import { hasUserKey } from "../../util/key-manager";

View File

@ -1,11 +1,11 @@
import { types as t } from "@marko/compiler";
import write from "../../util/vdom-out-write";
import * as FLAGS from "../../util/runtime-flags";
import { getAttrs, evaluateAttr } from "../util";
import { evaluateAttr, getAttrs } from "../util";
import {
getTagDef,
normalizeTemplateString,
importDefault,
normalizeTemplateString,
} from "@marko/babel-utils";
import withPreviousLocation from "../../util/with-previous-location";

View File

@ -1,7 +1,7 @@
import {
assertNoArgs,
assertNoParams,
assertNoAttributes,
assertNoParams,
} from "@marko/babel-utils";
import write from "../../util/html-out-write";

View File

@ -1,6 +1,6 @@
import path from "path";
import { types as t } from "@marko/compiler";
import { assertNoParams, assertNoAttributes } from "@marko/babel-utils";
import { assertNoAttributes, assertNoParams } from "@marko/babel-utils";
export function enter(tag) {
const {

View File

@ -1,8 +1,8 @@
import { types as t } from "@marko/compiler";
import {
getArgOrSequence,
assertNoAttributes,
assertNoParams,
getArgOrSequence,
} from "@marko/babel-utils";
import withPreviousLocation from "../../util/with-previous-location";

View File

@ -1,8 +1,8 @@
import { types as t } from "@marko/compiler";
import {
normalizeTemplateString,
isTransparentTag,
isLoopTag,
isTransparentTag,
normalizeTemplateString,
} from "@marko/babel-utils";
const KeyManagerLookup = new WeakMap();

View File

@ -1,10 +1,10 @@
import { decode } from "he";
import { types as t } from "@marko/compiler";
import {
importDefault,
isNativeTag,
isLoopTag,
getTagDef,
importDefault,
isLoopTag,
isNativeTag,
} from "@marko/babel-utils";
import { getKeyManager } from "./key-manager";
import write from "./vdom-out-write";