stylelint-no-unresolved-module
Version:
Ensures that module (import-like or `url`) can be resolved to a module on the file system.
57 lines • 1.68 kB
TypeScript
export default NodeResolver;
export namespace postcss {
type Root = import('postcss').Root;
type ChildNode = import('postcss').ChildNode;
}
export type NodeResolverOptions = {
cssRoot: postcss.Root | null;
cwd: string;
alias: Record<string, (string | string[])>;
roots: string[];
extensions: string[];
conditionNames: string[];
mainFields: string[];
mainFiles: string[];
modules: string[];
};
declare class NodeResolver {
/**
* @param {NodeResolverOptions} options
*/
constructor(options: NodeResolverOptions);
cwd: string;
alias: Record<string, string | string[]>;
roots: string[];
extensions: string[];
conditionNames: string[];
mainFields: string[];
mainFiles: string[];
modules: string[];
cssRoot: import("postcss/lib/root").default | null;
context: string;
importAtRules: string[];
enhancedResolve: ResolverFactory;
/**
* @param {string} entry
*/
resolvePath(entry: string): Promise<string>;
/**
* @param {string} value
* @param {postcss.ChildNode} rootNode
*/
resolve(value: string, rootNode: postcss.ChildNode): false | {
promise: Promise<string>;
message: (resource: string, rootNode: postcss.ChildNode) => string;
};
/**
* @param {string} resource
* @param {postcss.ChildNode} rootNode
*/
message(resource: string, rootNode: postcss.ChildNode): string;
/**
* @param {postcss.ChildNode} rootNode
*/
isGenericUrlImport(rootNode: postcss.ChildNode): boolean;
}
import { ResolverFactory } from "oxc-resolver";
//# sourceMappingURL=node.d.ts.map