diff --git a/src/index.ts b/src/index.ts index ff9245d8a..5d34ef1b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -182,5 +182,5 @@ export = { configs, flatConfigs, rules, - importXResolverCompat + importXResolverCompat, } diff --git a/src/utils/resolve.ts b/src/utils/resolve.ts index 6ce9b06c8..08f000cd0 100644 --- a/src/utils/resolve.ts +++ b/src/utils/resolve.ts @@ -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 } @@ -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 diff --git a/test/utils/resolve.spec.ts b/test/utils/resolve.spec.ts index 67d00208a..64bdbb894 100644 --- a/test/utils/resolve.spec.ts +++ b/test/utils/resolve.spec.ts @@ -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', () => {