Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use type imports for AJV where possible #2415

Merged
merged 1 commit into from
Feb 4, 2025
Merged
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
3 changes: 2 additions & 1 deletion packages/angular/src/library/jsonforms-root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import {
ValidationMode,
defaultMiddleware,
} from '@jsonforms/core';
import Ajv, { ErrorObject } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject } from 'ajv';
import { JsonFormsAngularService, USE_STATE_VALUE } from './jsonforms.service';
import { Subscription } from 'rxjs';

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/reducers/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import {
UpdateCoreAction,
} from '../actions';
import { JsonFormsCore, Reducer, ValidationMode } from '../store';
import Ajv, { ErrorObject } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject } from 'ajv';
import isFunction from 'lodash/isFunction';
import { createAjv, validate } from '../util';

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/store/jsonFormsCore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ajv, { ErrorObject } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject } from 'ajv';
import { JsonSchema, UISchemaElement } from '../models';
import get from 'lodash/get';
import { errorsAt } from '../util';
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import type { Store } from './type';
import { RankedTester, UISchemaTester } from '../testers';
import { JsonSchema, UISchemaElement } from '../models';
import Ajv, { ErrorObject, ValidateFunction } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject, ValidateFunction } from 'ajv';
import { JsonFormsI18nState } from './i18nTypes';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/material-renderers/src/util/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
import isEmpty from 'lodash/isEmpty';
import React, { ComponentType } from 'react';
import Ajv from 'ajv';
import type Ajv from 'ajv';
import type { UISchemaElement } from '@jsonforms/core';
import {
getAjv,
Expand Down
2 changes: 1 addition & 1 deletion packages/vanilla-renderers/src/util/props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
THE SOFTWARE.
*/

import Ajv from 'ajv';
import type Ajv from 'ajv';
import React, { ComponentType, useMemo } from 'react';
import isEmpty from 'lodash/isEmpty';
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-vuetify/dev/validate/keywords.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ajv from 'ajv';
import type Ajv from 'ajv';
import keywords from 'ajv-keywords';
import dynamicDefaults from 'ajv-keywords/dist/definitions/dynamicDefaults';
import tranform from './transform';
Expand Down
3 changes: 2 additions & 1 deletion packages/vue-vuetify/tests/unit/util/TestComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
type JsonFormsChangeEvent,
type MaybeReadonly,
} from '@jsonforms/vue';
import Ajv, { type ErrorObject } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject } from 'ajv';
import { defineComponent, reactive, type PropType } from 'vue';
import { VApp } from 'vuetify/components';

Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/components/JsonForms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
import { JsonFormsChangeEvent, MaybeReadonly } from '../types';
import DispatchRenderer from './DispatchRenderer.vue';

import Ajv, { ErrorObject } from 'ajv';
import type Ajv from 'ajv';
import type { ErrorObject } from 'ajv';

// TODO fix @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down
Loading