UNPKG

eslint-plugin-sonarjs

Version:
28 lines (27 loc) • 1.84 kB
import type { File, NormalizedAbsolutePath } from '../files.js'; export declare const PACKAGE_JSON = "package.json"; export declare const DENO_JSON = "deno.json"; export declare const DENO_JSONC = "deno.jsonc"; export declare const PNPM_WORKSPACE_YAML = "pnpm-workspace.yaml"; export declare const DEPENDENCY_MANIFESTS: readonly ["deno.json", "deno.jsonc", "package.json"]; export declare const PRELOADABLE_DEPENDENCY_MANIFESTS: readonly ["deno.json", "deno.jsonc", "package.json", "pnpm-workspace.yaml"]; export type PreloadableDependencyManifestName = (typeof PRELOADABLE_DEPENDENCY_MANIFESTS)[number]; export declare function isPreloadableDependencyManifestPath(path: NormalizedAbsolutePath): boolean; /** * Preloads manifest lookup caches so later rules can resolve manifests * without re-walking the file system. */ export declare function fillManifestCaches(manifestName: PreloadableDependencyManifestName, manifests: Map<NormalizedAbsolutePath, File>, dirnameToParent: Map<NormalizedAbsolutePath, NormalizedAbsolutePath | undefined>, topDir: NormalizedAbsolutePath, canAccessFileSystem?: boolean): void; /** * Whether a lookup backed by a preloaded cache may continue above its top directory. * Direct ESLint lookups have no preloaded entry and use the filesystem by default. */ export declare function canSearchFileSystemAboveManifestCache(manifestName: PreloadableDependencyManifestName, topDir: NormalizedAbsolutePath): boolean; /** * In the case of SonarIDE, when a dependency manifest file changes, the cache can become obsolete. */ export declare function clearDependenciesCache(): void; /** * Returns the preloadable dependency manifest filename if the path points to one. */ export declare function getPreloadableDependencyManifestName(path: NormalizedAbsolutePath): PreloadableDependencyManifestName | undefined;