Skip to content

Commit

Permalink
fix(core): eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Oct 13, 2024
1 parent 56ecac7 commit 8b03846
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ export default config({
stylistic: false,
typescript: {
overrides: {
'ts/no-namespace': 'off'
'ts/no-namespace': 'off',
'ts/no-empty-object-type': 'off',
'ts/method-signature-style': 'off',
'ts/no-use-before-define': 'off'
}
},
javascript: {
overrides: {
'unused-imports/no-unused-vars': 'off'
}
}
})
3 changes: 2 additions & 1 deletion packages/core/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const CANT_OVERRIDE = Object.freeze([
'shape'
] as const)
export function t<const T extends any[]>(...types: T): Typp<T> {
// eslint-disable-next-line no-undef-init
let shape: unknown = undefined
let consumerAttachedFields: Record<string, unknown> = {}
for (const consumer of consumers) {
Expand Down Expand Up @@ -356,7 +357,7 @@ export namespace t {
key: K, resolver: ResolverUtils[K], options: UseResolverOptions = {}
) {
if (typeof resolver !== 'function') {
throw new Error(`You can't use resolver for typp, because the resolver "${key}" is not a function`)
throw new TypeError(`You can't use resolver for typp, because the resolver "${key}" is not a function`)
}
const isExisted = Object.hasOwnProperty.call(utils, key)
if (isExisted && !options.override) {
Expand Down
1 change: 1 addition & 0 deletions tsconfigs/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ES2015",
"strict": true,
"strictNullChecks": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 8b03846

Please sign in to comment.