Skip to content

Commit

Permalink
chore: make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Dec 2, 2024
1 parent 3b02273 commit 1ba821d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ export = {
configs,
flatConfigs,
rules,
importXResolverCompat
importXResolverCompat,
}
9 changes: 7 additions & 2 deletions src/utils/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ function fullResolve(
: `settings['import-x/resolver-next'][${i}]`

if (!isValidNewResolver(resolver)) {
const err = new TypeError(`${resolverName} is not a valid import resolver for eslint-plugin-import-x!`)
const err = new TypeError(
`${resolverName} is not a valid import resolver for eslint-plugin-import-x!`,
)
err.name = IMPORT_RESOLVE_ERROR_NAME
throw err
}
Expand Down Expand Up @@ -236,7 +238,10 @@ export function resolve(p: string, context: RuleContext) {
}
}

export function importXResolverCompat(resolver: LegacyResolver | NewResolver, resolverOptions: unknown = {}): NewResolver {
export function importXResolverCompat(
resolver: LegacyResolver | NewResolver,
resolverOptions: unknown = {},
): NewResolver {
// Somehow the resolver is already using v3 interface
if (isValidNewResolver(resolver)) {
return resolver
Expand Down
6 changes: 3 additions & 3 deletions test/utils/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import type { TSESLint } from '@typescript-eslint/utils'

import { testContext, testFilePath } from '../utils'

import eslintPluginImportX from 'eslint-plugin-import-x'
import {
CASE_SENSITIVE_FS,
fileExistsWithCaseSync,
resolve
resolve,
} from 'eslint-plugin-import-x/utils'

import eslintPluginImportX from 'eslint-plugin-import-x'
const { importXResolverCompat } = eslintPluginImportX;
const { importXResolverCompat } = eslintPluginImportX

describe('resolve', () => {
it('throws on bad parameters', () => {
Expand Down

0 comments on commit 1ba821d

Please sign in to comment.