1 | import type { Rule } from 'eslint';
|
2 |
|
3 | import type ModuleCache from './ModuleCache';
|
4 | import type { ESLintSettings } from './types';
|
5 |
|
6 | export type ResultNotFound = { found: false, path?: undefined };
|
7 | export type ResultFound = { found: true, path: string | null };
|
8 | export type ResolvedResult = ResultNotFound | ResultFound;
|
9 |
|
10 | export type ResolverResolve = (modulePath: string, sourceFile:string, config: unknown) => ResolvedResult;
|
11 | export type ResolverResolveImport = (modulePath: string, sourceFile:string, config: unknown) => string | undefined;
|
12 | export type Resolver = { interfaceVersion?: 1 | 2, resolve: ResolverResolve, resolveImport: ResolverResolveImport };
|
13 |
|
14 | declare function resolve(
|
15 | p: string,
|
16 | context: Rule.RuleContext,
|
17 | ): ResolvedResult['path'];
|
18 |
|
19 | export default resolve;
|
20 |
|
21 | declare function fileExistsWithCaseSync(
|
22 | filepath: string | null,
|
23 | cacheSettings: ESLintSettings,
|
24 | strict: boolean
|
25 | ): boolean | ReturnType<typeof ModuleCache.prototype.get>;
|
26 |
|
27 | declare function relative(modulePath: string, sourceFile: string, settings: ESLintSettings): ResolvedResult['path'];
|
28 |
|
29 |
|
30 | export { fileExistsWithCaseSync, relative };
|