Merge pull request #151 from umbraco/chore/lint-import-order
Linting rule for import order
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
"rules": {
|
||||
"no-var": "error",
|
||||
"import/no-unresolved": "error",
|
||||
"import/order": "warn",
|
||||
"local-rules/bad-type-import": "error"
|
||||
},
|
||||
"settings": {
|
||||
|
||||
@@ -11,13 +11,13 @@ import { UUIIconRegistryEssential } from '@umbraco-ui/uui';
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
|
||||
import type { Guard, IRoute } from 'router-slot/model';
|
||||
import { getManifests, getServerStatus } from './core/api/fetcher';
|
||||
import { UmbContextProviderMixin } from './core/context';
|
||||
import { UmbExtensionRegistry } from './core/extension';
|
||||
import { internalManifests } from './temp-internal-manifests';
|
||||
|
||||
import type { ServerStatus } from './core/models';
|
||||
import type { Guard, IRoute } from 'router-slot/model';
|
||||
|
||||
@customElement('umb-app')
|
||||
export class UmbApp extends UmbContextProviderMixin(LitElement) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { UmbContextProviderMixin, UmbContextConsumerMixin } from '../../../core/
|
||||
import { UmbNotificationService } from '../../../core/services/notification';
|
||||
import { UmbDataTypeStore } from '../../../core/stores/data-type.store';
|
||||
import { DataTypeEntity } from '../../../mocks/data/data-type.data';
|
||||
import { UmbNotificationDefaultData } from '../../../core/services/notification/layouts/default';
|
||||
import { UmbDataTypeContext } from './data-type.context';
|
||||
|
||||
import '../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
@@ -14,7 +15,6 @@ import '../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
// Lazy load
|
||||
// TODO: Make this dynamic, use load-extensions method to loop over extensions for this node.
|
||||
import './views/editor-view-data-type-edit.element';
|
||||
import { UmbNotificationDefaultData } from '../../../core/services/notification/layouts/default';
|
||||
|
||||
@customElement('umb-editor-data-type')
|
||||
export class UmbEditorDataTypeElement extends UmbContextProviderMixin(UmbContextConsumerMixin(LitElement)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/
|
||||
import { UmbNotificationService } from '../../../core/services/notification';
|
||||
import { UmbDocumentTypeStore } from '../../../core/stores/document-type.store';
|
||||
import { DocumentTypeEntity } from '../../../mocks/data/document-type.data';
|
||||
import { UmbNotificationDefaultData } from '../../../core/services/notification/layouts/default';
|
||||
import { UmbDocumentTypeContext } from './document-type.context';
|
||||
|
||||
import '../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
@@ -14,7 +15,6 @@ import '../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
// Lazy load
|
||||
// TODO: Make this dynamic, use load-extensions method to loop over extensions for this node.
|
||||
import './views/editor-view-document-type-design.element';
|
||||
import { UmbNotificationDefaultData } from '../../../core/services/notification/layouts/default';
|
||||
|
||||
@customElement('umb-editor-document-type')
|
||||
export class UmbEditorDocumentTypeElement extends UmbContextProviderMixin(UmbContextConsumerMixin(LitElement)) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
import { UmbContextConsumerMixin } from '../../../../core/context';
|
||||
import type { DocumentTypeEntity } from '../../../../mocks/data/document-type.data';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
import { UmbDocumentTypeContext } from '../document-type.context';
|
||||
|
||||
@customElement('umb-editor-view-document-type-design')
|
||||
|
||||
@@ -2,11 +2,12 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { UUIInputElement, UUIInputEvent } from '@umbraco-ui/uui';
|
||||
import { distinctUntilChanged, Subscription } from 'rxjs';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../../core/context';
|
||||
import { UmbNodeStore } from '../../../../core/stores/node.store';
|
||||
import { distinctUntilChanged, Subscription } from 'rxjs';
|
||||
import { NodeEntity } from '../../../../mocks/data/node.data';
|
||||
import type { UmbNotificationService } from '../../../../core/services/notification';
|
||||
import { UmbNotificationDefaultData } from '../../../../core/services/notification/layouts/default';
|
||||
import { UmbNodeContext } from './node.context';
|
||||
|
||||
import '../../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
@@ -15,7 +16,6 @@ import '../../shared/editor-entity-layout/editor-entity-layout.element';
|
||||
// TODO: Make this dynamic, use load-extensions method to loop over extensions for this node.
|
||||
import './views/edit/editor-view-node-edit.element';
|
||||
import './views/info/editor-view-node-info.element';
|
||||
import { UmbNotificationDefaultData } from '../../../../core/services/notification/layouts/default';
|
||||
|
||||
@customElement('umb-editor-node')
|
||||
export class UmbEditorNodeElement extends UmbContextProviderMixin(UmbContextConsumerMixin(LitElement)) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
import { NodeProperty, NodePropertyData } from '../../../../../../mocks/data/node.data';
|
||||
import { UmbContextConsumerMixin } from '../../../../../../core/context';
|
||||
import { UmbNodeContext } from '../../node.context';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
|
||||
import '../../../../../components/node-property.element';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
import { UmbContextConsumerMixin } from '../../../../../../core/context';
|
||||
import { UmbNodeContext } from '../../node.context';
|
||||
import { Subscription, distinctUntilChanged } from 'rxjs';
|
||||
|
||||
@customElement('umb-editor-view-node-info')
|
||||
export class UmbEditorViewNodeInfoElement extends UmbContextConsumerMixin(LitElement) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbTreeDataTypesDataContext } from './tree-data-types-data.context';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeDataTypesDataContext } from './tree-data-types-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeDocumentTypesDataContext } from './tree-document-types-data.context';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeDocumentTypesDataContext } from './tree-document-types-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbTreeDocumentDataContext } from './tree-documents-data.context';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeDocumentDataContext } from './tree-documents-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbTreeExtensionsDataContext } from './tree-extensions-data.context';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeExtensionsDataContext } from './tree-extensions-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbTreeMediaDataContext } from './tree-media-data.context';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeMediaDataContext } from './tree-media-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbTreeMemberGroupsDataContext } from './tree-member-groups-data.context';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeMemberGroupsDataContext } from './tree-member-groups-data.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
|
||||
@customElement('umb-tree-member-groups')
|
||||
export class UmbTreeMemberGroups extends UmbContextProviderMixin(UmbContextConsumerMixin(UmbTreeBase)) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '../../../core/context';
|
||||
import { UmbTreeMembersDataContext } from './tree-members.context';
|
||||
import { UmbEntityStore } from '../../../core/stores/entity.store';
|
||||
import { UmbTreeBase } from '../shared/tree-base.element';
|
||||
import { UmbTreeMembersDataContext } from './tree-members.context';
|
||||
|
||||
import '../shared/tree-navigator.element';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import { map, Subscription } from 'rxjs';
|
||||
import type { ManifestTreeItemAction, ManifestTree } from '../../../../core/models';
|
||||
import { UmbExtensionRegistry } from '../../../../core/extension';
|
||||
import { UmbContextConsumerMixin } from '../../../../core/context';
|
||||
import { map, Subscription } from 'rxjs';
|
||||
import { UmbSectionContext } from '../../../sections/section.context';
|
||||
import { Entity } from '../../../../mocks/data/entities';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css';
|
||||
import { css, LitElement, nothing, PropertyValueMap } from 'lit';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { UmbContextProviderMixin } from '../../../../core/context';
|
||||
import UmbTreeItemActionElement, { ActionPageEntity } from '../tree-item-action.element';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
@customElement('umb-tree-context-menu-page-service')
|
||||
export class UmbTreeContextMenuPageService extends UmbContextProviderMixin(LitElement) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, property, state } from 'lit/decorators.js';
|
||||
import { UUIMenuItemEvent } from '@umbraco-ui/uui';
|
||||
import { map, Subscription } from 'rxjs';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import { UmbContextConsumerMixin } from '../../../core/context';
|
||||
import { UmbTreeContextBase } from '../tree.context';
|
||||
import { UUIMenuItemEvent } from '@umbraco-ui/uui';
|
||||
import { UmbSectionContext } from '../../sections/section.context';
|
||||
import { map, Subscription } from 'rxjs';
|
||||
import { Entity } from '../../../mocks/data/entities';
|
||||
import { UmbTreeContextMenuService } from './context-menu/tree-context-menu.service';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import { UmbTreeDataContextBase } from '../tree-data.context';
|
||||
import { UmbTreeContextMenuService } from './context-menu/tree-context-menu.service';
|
||||
|
||||
@customElement('umb-tree-item')
|
||||
export class UmbTreeItem extends UmbContextConsumerMixin(LitElement) {
|
||||
|
||||
@@ -2,8 +2,8 @@ import { css, html, LitElement } from 'lit';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
import { UmbContextConsumerMixin } from '../../../core/context';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { UmbContextConsumerMixin } from '../../../core/context';
|
||||
import { Entity } from '../../../mocks/data/entities';
|
||||
import { UmbTreeDataContextBase } from '../tree-data.context';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ManifestTypes } from '../models';
|
||||
import { hasDefaultExport } from './has-default-export.function';
|
||||
import { isManifestElementType } from './is-extension.function';
|
||||
import { loadExtension } from './load-extension.function';
|
||||
|
||||
import type { ManifestTypes } from '../models';
|
||||
|
||||
export async function createExtensionElement(manifest: ManifestTypes): Promise<HTMLElement | undefined> {
|
||||
//TODO: Write tests for these extension options:
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
import { BehaviorSubject, map, Observable } from 'rxjs';
|
||||
|
||||
import { createExtensionElement } from './create-extension-element.function';
|
||||
|
||||
export type UmbExtensionManifestJSModel = {
|
||||
elementName?: string;
|
||||
};
|
||||
|
||||
import type {
|
||||
ManifestTypes,
|
||||
ManifestDashboard,
|
||||
@@ -20,6 +13,11 @@ import type {
|
||||
ManifestCustom,
|
||||
ManifestPackageView,
|
||||
} from '../models';
|
||||
import { createExtensionElement } from './create-extension-element.function';
|
||||
|
||||
export type UmbExtensionManifestJSModel = {
|
||||
elementName?: string;
|
||||
};
|
||||
|
||||
// TODO: add to schema
|
||||
export type ManifestBase = {
|
||||
|
||||
@@ -5,10 +5,10 @@ import './layouts/content-picker/modal-layout-content-picker.element';
|
||||
import { UUIModalSidebarSize } from '@umbraco-ui/uui-modal-sidebar';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
|
||||
import { UmbModalHandler } from './';
|
||||
|
||||
import type { UmbModalConfirmData } from './layouts/confirm/modal-layout-confirm.element';
|
||||
import type { UmbModalContentPickerData } from './layouts/content-picker/modal-layout-content-picker.element';
|
||||
import { UmbModalHandler } from './';
|
||||
|
||||
export type UmbModelType = 'dialog' | 'sidebar';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { html, LitElement } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import { UUITextStyles } from '@umbraco-ui/uui-css';
|
||||
import type { UmbNotificationHandler } from '../../';
|
||||
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
||||
import type { UmbNotificationHandler } from '../../';
|
||||
|
||||
export interface UmbNotificationDefaultData {
|
||||
message: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { fixture, expect, html } from '@open-wc/testing';
|
||||
import { UUIToastNotificationLayoutElement } from '@umbraco-ui/uui';
|
||||
import { UmbNotificationHandler } from '../../';
|
||||
import type { UmbNotificationLayoutDefaultElement, UmbNotificationDefaultData } from '.';
|
||||
import '.';
|
||||
import { UUIToastNotificationLayoutElement } from '@umbraco-ui/uui';
|
||||
|
||||
describe('UmbNotificationLayoutDefault', () => {
|
||||
let element: UmbNotificationLayoutDefaultElement;
|
||||
|
||||
@@ -6,10 +6,10 @@ import { Meta, Story } from '@storybook/web-components';
|
||||
import { html, LitElement } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
|
||||
import { UmbNotificationColor, UmbNotificationOptions, UmbNotificationService } from '.';
|
||||
import { UmbContextConsumerMixin } from '../../context';
|
||||
|
||||
import type { UmbNotificationDefaultData } from './layouts/default';
|
||||
import { UmbNotificationColor, UmbNotificationOptions, UmbNotificationService } from '.';
|
||||
export default {
|
||||
title: 'API/Notifications/Overview',
|
||||
component: 'ucp-notification-layout-default',
|
||||
|
||||
@@ -2,9 +2,9 @@ import { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from 'lit-html';
|
||||
import { rest } from 'msw';
|
||||
|
||||
import type { UmbInstallerDatabaseElement } from './installer-database.element';
|
||||
import type { UmbracoInstaller } from '../../core/models';
|
||||
import { installerContextProvider } from '../shared/utils.story-helpers';
|
||||
import type { UmbInstallerDatabaseElement } from './installer-database.element';
|
||||
import './installer-database.element';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from 'lit-html';
|
||||
|
||||
import type { UmbInstallerErrorElement } from './installer-error.element';
|
||||
import { installerContextProvider } from '../shared/utils.story-helpers';
|
||||
import './installer-error.element';
|
||||
import { UmbInstallerContext } from '../installer.context';
|
||||
import type { UmbInstallerErrorElement } from './installer-error.element';
|
||||
|
||||
import './installer-error.element';
|
||||
|
||||
const error = {
|
||||
type: 'validation',
|
||||
|
||||
@@ -8,9 +8,9 @@ import './user/installer-user.element';
|
||||
import { css, CSSResultGroup, html, LitElement } from 'lit';
|
||||
import { customElement, state } from 'lit/decorators.js';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
import { UmbContextProviderMixin } from '../core/context';
|
||||
import { UmbInstallerContext } from './installer.context';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@customElement('umb-installer')
|
||||
export class UmbInstallerElement extends UmbContextProviderMixin(LitElement) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from 'lit-html';
|
||||
|
||||
import type { UmbInstallerInstallingElement } from './installer-installing.element';
|
||||
import { installerContextProvider } from '../shared/utils.story-helpers';
|
||||
import type { UmbInstallerInstallingElement } from './installer-installing.element';
|
||||
import './installer-installing.element';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from 'lit-html';
|
||||
|
||||
import type { UmbInstallerUserElement } from './installer-user.element';
|
||||
import { installerContextProvider } from '../shared/utils.story-helpers';
|
||||
import type { UmbInstallerUserElement } from './installer-user.element';
|
||||
import './installer-user.element';
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user