Skip to content

Commit

Permalink
fix(ts): ensure typechecks pass without peer deps installed
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Feb 22, 2023
1 parent 6da77e9 commit 779cddf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ const config = {
'unicorn/string-content': 0
}
},
{
files: [
'src/interfaces/options-get-format.ts',
'src/interfaces/options-get-source.ts'
],
rules: {
'@typescript-eslint/prefer-ts-expect-error': 0
}
},
{
files: ['src/utils/find-exports.ts'],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/options-get-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import type { Format } from '#src/enums'
import type { Ext } from '@flex-development/pathe'
import type { EmptyString } from '@flex-development/tutils'
import type { RequestInit } from 'node-fetch'

/**
* Module format retrieval options.
Expand Down Expand Up @@ -75,7 +74,8 @@ interface GetFormatOptions {
*
* @default {}
*/
req?: RequestInit | undefined
// @ts-ignore peer dependency
req?: import('node-fetch').RequestInit | undefined
}

export type { GetFormatOptions as default }
4 changes: 2 additions & 2 deletions src/interfaces/options-get-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import type { Format } from '#src/enums'
import type { RequestInit } from 'node-fetch'

/**
* Source code retrieval options.
Expand Down Expand Up @@ -53,7 +52,8 @@ interface GetSourceOptions {
*
* @default {}
*/
req?: RequestInit | undefined
// @ts-ignore peer dependency
req?: import('node-fetch').RequestInit | undefined
}

export type { GetSourceOptions as default }

0 comments on commit 779cddf

Please sign in to comment.