Skip to content
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
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@
},
"bugs": "https://github.com/dwightjack/vue-types/issues",
"devDependencies": {
"@changesets/cli": "2.27.3",
"@changesets/cli": "2.27.8",
"@eslint/js": "9.8.0",
"@vitest/coverage-v8": "2.0.5",
"eslint": "9.8.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"happy-dom": "15.7.4",
"lefthook": "1.7.4",
"prettier": "3.3.1",
"typescript": "5.5.3",
"typescript-eslint": "8.0.0-alpha.16",
"lefthook": "1.7.18",
"prettier": "3.3.3",
"typescript": "5.5.4",
"typescript-eslint": "8.0.1",
"vite": "5.3.6",
"vitest": "2.0.5"
},
"dependencies": {
"eslint": "9.11.1"
}
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
"devDependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@types/node": "20.14.2",
"@types/node": "20.14.15",
"babel-plugin-transform-node-env-inline": "0.4.3",
"cpy-cli": "5.0.0",
"cross-env": "7.0.3",
"del": "7.1.0",
"del-cli": "5.1.0",
"microbundle": "0.15.1",
"typescript": "5.5.3"
"typescript": "5.5.4"
},
"dependencies": {
"is-plain-object": "5.0.0"
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function createValidator(

export function fromType(name: string, source: any, props: any = {}) {
const t = type(name, Object.assign({}, source, props), !!source.validable)
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
t.validator && delete t.validator
return t
}
Expand Down Expand Up @@ -216,6 +217,7 @@ export function validateType<T, U>(
}

if (process.env.NODE_ENV !== 'production') {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
config.silent === false &&
console.warn(
'You are using the production shimmed version of VueTypes in a development build. Refer to https://dwightjack.github.io/vue-types/guide/installation.html#production-build to learn how to configure VueTypes for usage in multiple environments.',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type PropMethod<T, TConstructor = any> = T extends (...args: any) => any
}
: never

// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export type NativeType = string | boolean | number | null | undefined | Function

export type Constructor = new (...args: any[]) => any
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const isArray =
* @param {any} value - Value to check
* @returns {boolean}
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export const isFunction = <T extends Function>(value: unknown): value is T =>
toString.call(value) === '[object Function]'

Expand Down Expand Up @@ -159,7 +159,7 @@ export function bindTo(fn: (...args: any[]) => any, ctx: any): WrappedFn {
*
* @param fn - Function to unwrap
*/
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export function unwrap<T extends WrappedFn | Function>(fn: T) {
return (fn as WrappedFn).__original ?? fn
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/validators/oneof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function oneOf<D, T extends readonly D[] = readonly D[]>(
(ret, v) => {
if (v !== null && v !== undefined) {
const constr = (v as any).constructor
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
ret.indexOf(constr) === -1 && ret.push(constr)
}
return ret
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"cross-env": "7.0.3",
"markdown-it-container": "4.0.0",
"vitepress": "1.3.1",
"vue": "3.4.27"
"vitepress": "1.3.4",
"vue": "3.4.38"
}
}
1 change: 1 addition & 0 deletions packages/examples/shared/default-namespace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */
import VueTypes, { VueTypesInterface, VueTypeValidableDef } from 'vue-types'
import { VueTypesProject } from './namespaced-extended'

Expand Down
4 changes: 1 addition & 3 deletions packages/examples/shared/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ export const anyTypeCast = any<unknown>()
* `func` validator examples
*/
type OnClick = (e: MouseEvent) => void
export const funcType = func<OnClick>().def((e: Event) => {
e.target
})
export const funcType = func<OnClick>().def((e: Event) => e.target)

/**
* `bool` validator examples
Expand Down
Loading
Loading