Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit e0d8e75

Browse files
committed
fix(lint): fixed linter warnings
1 parent 13cac5a commit e0d8e75

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
dist/
2+
*.config.js

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname $0)/_/husky.sh"
33

4-
npm run test
4+
npm run lint

src/components/checkbox-input/CheckboxInput.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@vue/test-utils';
22
import CheckboxInput from './CheckboxInput.vue';
3-
import { FieldControl, CheckboxField, Validator, required } from '../../index';
3+
import { FieldControl, CheckboxField } from '../../index';
44

55
describe('CheckboxInput', () => {
66
let cmp;

src/components/radio-input/RadioInput.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mount } from '@vue/test-utils';
22
import RadioInput from './RadioInput.vue';
3-
import { FieldControl, RadioField, Validator, required } from '../../index';
3+
import { FieldControl, RadioField } from '../../index';
44

55
describe('RadioInput', () => {
66
let cmp;

src/composables/useDynamicForm.spec.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import {
23
CheckboxField,
34
EmailField,
4-
FieldControl,
55
PasswordField,
66
TextField,
77
} from '@/core/factories';
8-
import { dynamicFormsSymbol } from '@/useApi';
9-
import { provide, ref } from 'vue';
108
import { useDynamicForm } from './useDynamicForm';
119

1210
describe('UseDynamicForm', () => {
13-
let form;
14-
let ctx;
11+
let form: any;
12+
let ctx: any;
1513
beforeEach(() => {
1614
form = {
1715
id: 'login-demo',

src/composables/useDynamicForm.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
FormChanges,
77
ValidationEvent,
88
InputEvent,
9-
FormOptions,
109
DynamicForm,
1110
} from '@/core/models';
1211
import {
@@ -22,6 +21,7 @@ import {
2221
import { deepClone, hasValue, removeEmpty } from '@/core/utils/helpers';
2322
import { FieldControl } from '@/core/factories';
2423
import { useDebounceFn } from './useDebounce';
24+
import { DynamicFormsOptions } from '@/dynamicForms';
2525

2626
interface DynamicFormComposition {
2727
controls: Ref<FormControl<InputType>[]>;
@@ -45,8 +45,12 @@ interface DynamicFormComposition {
4545

4646
export function useDynamicForm(
4747
form: DynamicForm,
48-
ctx,
49-
options?,
48+
ctx: {
49+
// eslint-disable-next-line @typescript-eslint/ban-types
50+
slots: {};
51+
emit: (arg0: string, arg1: { [x: string]: string | number }) => void;
52+
},
53+
options?: DynamicFormsOptions,
5054
): DynamicFormComposition {
5155
let cache = deepClone(toRaw(form.fields));
5256

src/core/utils/warning.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export function warn(msg: string, ...args: any[]): void {
1+
export function warn(msg: string, ...args: unknown[]): void {
22
console.warn('[DynamicForms warn]: ' + msg, ...args);
33
}

0 commit comments

Comments
 (0)