Skip to content
Open
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 src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ export interface ParseError extends Error {
column: number
}

export interface CustomESTreeNode<Type extends string>
extends Omit<TSESTree.BaseNode, 'type'> {
export interface CustomESTreeNode<Type extends string> extends Omit<
TSESTree.BaseNode,
'type'
> {
type: Type
}

export type ExportDefaultSpecifier = CustomESTreeNode<'ExportDefaultSpecifier'>

export interface ExportNamespaceSpecifier
extends CustomESTreeNode<'ExportNamespaceSpecifier'> {
export interface ExportNamespaceSpecifier extends CustomESTreeNode<'ExportNamespaceSpecifier'> {
exported: TSESTree.Identifier
}

Expand Down Expand Up @@ -164,7 +165,8 @@ export interface CjsRequire extends NodeJS.Require {
export type SetValue<T extends Set<unknown>> =
T extends Set<infer U> ? U : never

export interface NormalizedCacheSettings
extends NonNullable<ImportSettings['cache']> {
export interface NormalizedCacheSettings extends NonNullable<
ImportSettings['cache']
> {
lifetime: number
}
5 changes: 2 additions & 3 deletions test/utils/export-map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,8 @@ describe('ExportMap', () => {
it.skip('should cache tsconfig until tsconfigRootDir parser option changes', async () => {
jest.resetModules()

const { ExportMap: FreshNewExportMap } = await import(
'eslint-plugin-import-x/utils'
)
const { ExportMap: FreshNewExportMap } =
await import('eslint-plugin-import-x/utils')

expect(FreshNewExportMap).not.toBe(ExportMap)
expect(spied).toHaveBeenCalledTimes(0)
Expand Down
5 changes: 2 additions & 3 deletions test/utils/npm-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ describe('npm-client', () => {
beforeEach(async () => {
delete process.env.npm_config_user_agent
jest.resetModules()
;({ getNpmClient, getNpmInstallCommand } = await import(
'eslint-plugin-import-x/utils'
))
;({ getNpmClient, getNpmInstallCommand } =
await import('eslint-plugin-import-x/utils'))
})

it('should return npm as default client', () => {
Expand Down
15 changes: 6 additions & 9 deletions test/utils/parse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ describe('parse(content, { settings, ecmaFeatures })', () => {

it('passes with custom `parseForESLint` parser', async () => {
jest.resetModules()
const { parse: freshNewParse } = await import(
'eslint-plugin-import-x/utils'
)
const { parse: freshNewParse } =
await import('eslint-plugin-import-x/utils')
expect(freshNewParse).not.toBe(parse)

const { setParseForESLint, setParse } = __importDefault(
Expand Down Expand Up @@ -138,9 +137,8 @@ describe('parse(content, { settings, ecmaFeatures })', () => {

it('takes the alternate parser specified in settings', async () => {
jest.resetModules()
const { parse: freshNewParse } = await import(
'eslint-plugin-import-x/utils'
)
const { parse: freshNewParse } =
await import('eslint-plugin-import-x/utils')
expect(freshNewParse).not.toBe(parse)
const { setParse } = __importDefault(
await import('./parse-stub-parser.cjs'),
Expand Down Expand Up @@ -312,9 +310,8 @@ describe('parse(content, { settings, ecmaFeatures })', () => {

it('prefers parsers specified in the settings over languageOptions.parser', async () => {
jest.resetModules()
const { parse: freshNewParse } = await import(
'eslint-plugin-import-x/utils'
)
const { parse: freshNewParse } =
await import('eslint-plugin-import-x/utils')
expect(freshNewParse).not.toBe(parse)
const parseSpy = jest.fn()

Expand Down
Loading
Loading