Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/@n8n_io/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ const config = (module.exports = {
*/
'@typescript-eslint/consistent-type-assertions': 'error',

/**
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-imports.md
*/
'@typescript-eslint/consistent-type-imports': 'error',

/**
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module.exports = {
],

rules: {
'@typescript-eslint/consistent-type-imports': 'error',

// TODO: Remove this
'import/no-cycle': 'warn',
'import/order': 'off',
Expand Down
2 changes: 0 additions & 2 deletions packages/core/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module.exports = {
ignorePatterns: ['bin/*.js'],

rules: {
'@typescript-eslint/consistent-type-imports': 'error',

// TODO: Remove this
'import/order': 'off',
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': true }],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
</template>

<script lang="ts">
import Vue, { PropType } from 'vue';
import type { PropType } from 'vue';
import Vue from 'vue';
import {
Dropdown as ElDropdown,
DropdownMenu as ElDropdownMenu,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { computed, defineComponent, PropType, ref, useCssModule } from 'vue';
import {
import type { PropType } from 'vue';
import { computed, defineComponent, ref, useCssModule } from 'vue';
import type {
DatatableColumn,
DatatableRow,
DatatableRowDataType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineComponent, h, PropType } from 'vue';
import { DatatableRow } from '../mixins';
import type { PropType } from 'vue';
import { defineComponent, h } from 'vue';
import type { DatatableRow } from '../mixins';
import N8nButton from '../../N8nButton';

// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VNode } from 'vue';
import type { VNode } from 'vue';

export type DatatableRowDataType = string | number | boolean | null | undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import N8nCheckbox from '../N8nCheckbox';
import ElSwitch from 'element-ui/lib/switch';

import { getValidationError, VALIDATORS } from './validators';
import { Rule, RuleGroup, IValidator, Validatable, FormState } from '../../types';
import type { Rule, RuleGroup, IValidator, Validatable, FormState } from '../../types';

import { t } from '../../locale';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IValidator, RuleGroup, Validatable } from '../../types';
import type { IValidator, RuleGroup, Validatable } from '../../types';

export const emailRegex =
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
</template>

<script lang="ts">
import Vue, { PropType } from 'vue';
import type { PropType } from 'vue';
import Vue from 'vue';
import N8nFormInput from '../N8nFormInput';
import type { IFormInput } from '../../types';
import ResizeObserver from '../ResizeObserver';
import { EventBus } from '@/utils';
import type { EventBus } from '@/utils';

export default Vue.extend({
name: 'n8n-form-inputs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<script lang="ts">
import N8nText from '../N8nText';
import N8nIcon from '../N8nIcon';
import Vue, { PropType } from 'vue';
import type { PropType } from 'vue';
import Vue from 'vue';

interface IAccordionItem {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ interface Options {
tasklists: typeof DEFAULT_OPTIONS_TASKLISTS;
}

import Vue, { PropType } from 'vue';
import type { PropType } from 'vue';
import Vue from 'vue';

export default Vue.extend({
components: {
Expand Down
5 changes: 3 additions & 2 deletions packages/design-system/src/components/N8nMenu/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
import { Menu as ElMenu } from 'element-ui';
import N8nMenuItem from '../N8nMenuItem';

import Vue, { PropType } from 'vue';
import { IMenuItem } from '../../types';
import type { PropType } from 'vue';
import Vue from 'vue';
import type { IMenuItem } from '../../types';

export default Vue.extend({
name: 'n8n-menu',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
import { Submenu as ElSubmenu, MenuItem as ElMenuItem } from 'element-ui';
import N8nTooltip from '../N8nTooltip';
import N8nIcon from '../N8nIcon';
import { IMenuItem } from '../../types';
import Vue, { PropType } from 'vue';
import type { IMenuItem } from '../../types';
import type { PropType } from 'vue';
import Vue from 'vue';

export default Vue.extend({
name: 'n8n-menu-item',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import N8nNodeCreatorNode from './NodeCreatorNode.vue';
import { StoryFn } from '@storybook/vue';
import type { StoryFn } from '@storybook/vue';

export default {
title: 'Modules/Node Creator Node',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
import type { StoryFn } from '@storybook/vue';
import N8nRecycleScroller from './RecycleScroller.vue';
import { ComponentInstance } from 'vue';
import type { ComponentInstance } from 'vue';

export default {
title: 'Atoms/RecycleScroller',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-use-before-define */

import {
computed,
defineComponent,
onMounted,
onBeforeMount,
ref,
PropType,
nextTick,
watch,
} from 'vue';
import type { PropType } from 'vue';
import { computed, defineComponent, onMounted, onBeforeMount, ref, nextTick, watch } from 'vue';

export default defineComponent({
name: 'n8n-recycle-scroller',
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/components/N8nTags/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import N8nTag from '../N8nTag';
import N8nLink from '../N8nLink';
import Locale from '../../mixins/locale';
import { PropType } from 'vue';
import type { PropType } from 'vue';
import mixins from 'vue-typed-mixins';

interface ITag {
Expand Down
3 changes: 2 additions & 1 deletion packages/design-system/src/components/N8nTooltip/Tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</template>

<script lang="ts">
import Vue, { PropType } from 'vue';
import type { PropType } from 'vue';
import Vue from 'vue';
import { Tooltip as ElTooltip } from 'element-ui';
import type { IN8nButton } from '@/types';
import N8nButton from '../N8nButton';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import 'vue';
import mixins from 'vue-typed-mixins';
import { Select as ElSelect, Option as ElOption } from 'element-ui';
import N8nUserInfo from '../N8nUserInfo';
import { IUser } from '../../types';
import type { IUser } from '../../types';
import Locale from '../../mixins/locale';
import { t } from '../../locale';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import N8nUsersList from './UsersList.vue';
import { action } from '@storybook/addon-actions';
import type { StoryFn } from '@storybook/vue';
import { IUser } from '@/types';
import type { IUser } from '@/types';

export default {
title: 'Modules/UsersList',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
</template>

<script lang="ts">
import { IUser, IUserListAction } from '../../types';
import type { IUser, IUserListAction } from '../../types';
import N8nActionToggle from '../N8nActionToggle';
import N8nBadge from '../N8nBadge';
import N8nUserInfo from '../N8nUserInfo';
import Locale from '../../mixins/locale';
import mixins from 'vue-typed-mixins';
import { PropType } from 'vue';
import type { PropType } from 'vue';

export default mixins(Locale).extend({
name: 'n8n-users-list',
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/src/plugins/n8nComponents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Vue from 'vue';
import type Vue from 'vue';
import N8nActionBox from '../components/N8nActionBox';
import N8nActionDropdown from '../components/N8nActionDropdown';
import N8nActionToggle from '../components/N8nActionToggle';
Expand Down
14 changes: 7 additions & 7 deletions packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CREDENTIAL_EDIT_MODAL_KEY } from './constants';
import type { CREDENTIAL_EDIT_MODAL_KEY } from './constants';
/* eslint-disable @typescript-eslint/no-explicit-any */
import { IMenuItem } from 'n8n-design-system';
import {
import type { IMenuItem } from 'n8n-design-system';
import type {
GenericValue,
IConnections,
ICredentialsDecrypted,
Expand Down Expand Up @@ -34,10 +34,10 @@ import {
ExecutionStatus,
ITelemetryTrackProperties,
} from 'n8n-workflow';
import { SignInType } from './constants';
import { FAKE_DOOR_FEATURES, TRIGGER_NODE_FILTER, REGULAR_NODE_FILTER } from './constants';
import { BulkCommand, Undoable } from '@/models/history';
import { PartialBy } from '@/utils/typeHelpers';
import type { SignInType } from './constants';
import type { FAKE_DOOR_FEATURES, TRIGGER_NODE_FILTER, REGULAR_NODE_FILTER } from './constants';
import type { BulkCommand, Undoable } from '@/models/history';
import type { PartialBy } from '@/utils/typeHelpers';

export * from 'n8n-design-system/types';

Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/__tests__/permissions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parsePermissionsTable } from '@/permissions';
import { IUser } from '@/Interface';
import type { IUser } from '@/Interface';

describe('parsePermissionsTable()', () => {
const user: IUser = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Response, Server } from 'miragejs';
import { AppSchema } from '../types';
import type { Server } from 'miragejs';
import { Response } from 'miragejs';
import type { AppSchema } from '../types';

export function routesForCredentials(server: Server) {
server.get('/rest/credentials', (schema: AppSchema) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Response, Server } from 'miragejs';
import { AppSchema } from '../types';
import type { Server } from 'miragejs';
import { Response } from 'miragejs';
import type { AppSchema } from '../types';

export function routesForCredentialTypes(server: Server) {
server.get('/types/credentials.json', (schema: AppSchema) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/__tests__/server/endpoints/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { routesForUsers } from './user';
import { routesForCredentials } from './credential';
import { Server } from 'miragejs';
import type { Server } from 'miragejs';
import { routesForCredentialTypes } from '@/__tests__/server/endpoints/credentialType';

const endpoints: Array<(server: Server) => void> = [
Expand Down
5 changes: 3 additions & 2 deletions packages/editor-ui/src/__tests__/server/endpoints/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Response, Server } from 'miragejs';
import { AppSchema } from '../types';
import type { Server } from 'miragejs';
import { Response } from 'miragejs';
import type { AppSchema } from '../types';

export function routesForUsers(server: Server) {
server.get('/rest/users', (schema: AppSchema) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ICredentialsResponse } from '@/Interface';
import type { ICredentialsResponse } from '@/Interface';
import { Model } from 'miragejs';
import type { ModelDefinition } from 'miragejs/-types';

Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/__tests__/server/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IUser } from '@/Interface';
import type { IUser } from '@/Interface';
import { Model } from 'miragejs';
import type { ModelDefinition } from 'miragejs/-types';

Expand Down
8 changes: 4 additions & 4 deletions packages/editor-ui/src/__tests__/server/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Registry } from 'miragejs';
import type { Registry } from 'miragejs';

// eslint-disable-next-line import/no-unresolved
import Schema from 'miragejs/orm/schema';
import type Schema from 'miragejs/orm/schema';

import { models } from './models';
import { factories } from './factories';
import type { models } from './models';
import type { factories } from './factories';

type AppRegistry = Registry<typeof models, typeof factories>;
export type AppSchema = Schema<AppRegistry>;
2 changes: 1 addition & 1 deletion packages/editor-ui/src/api/api-keys.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IRestApiContext } from '@/Interface';
import type { IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils';

export function getApiKey(context: IRestApiContext): Promise<{ apiKey: string | null }> {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/api/communityNodes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IRestApiContext } from '@/Interface';
import { PublicInstalledPackage } from 'n8n-workflow';
import type { IRestApiContext } from '@/Interface';
import type { PublicInstalledPackage } from 'n8n-workflow';
import { get, post, makeRestApiRequest } from '@/utils';

export async function getInstalledCommunityNodes(
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/api/credentials.ee.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface';
import type { ICredentialsResponse, IRestApiContext, IShareCredentialsPayload } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import { IDataObject } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';

export async function setCredentialSharedWith(
context: IRestApiContext,
Expand Down
8 changes: 6 additions & 2 deletions packages/editor-ui/src/api/credentials.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ICredentialsDecryptedResponse, ICredentialsResponse, IRestApiContext } from '@/Interface';
import type {
ICredentialsDecryptedResponse,
ICredentialsResponse,
IRestApiContext,
} from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import {
import type {
ICredentialsDecrypted,
ICredentialType,
IDataObject,
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/api/curlHelper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CurlToJSONResponse, IRestApiContext } from '@/Interface';
import type { CurlToJSONResponse, IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils';

export function getCurlToJson(
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/api/eventbus.ee.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IRestApiContext } from '@/Interface';
import type { IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import { IDataObject, MessageEventBusDestinationOptions } from 'n8n-workflow';
import type { IDataObject, MessageEventBusDestinationOptions } from 'n8n-workflow';

export async function saveDestinationToDb(
context: IRestApiContext,
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/api/ldap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface';
import type { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import { IDataObject } from 'n8n-workflow';
import type { IDataObject } from 'n8n-workflow';

export function getLdapConfig(context: IRestApiContext): Promise<ILdapConfig> {
return makeRestApiRequest(context, 'GET', '/ldap/config');
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/api/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
IRestApiContext,
IN8nPrompts,
IN8nValueSurveyData,
Expand Down
Loading