es-guard
Version:
A tool to check JavaScript compatibility with target environments
18 lines • 869 B
TypeScript
import type { Linter } from "eslint";
/**
* Converts a string target to Linter.EcmaVersion type.
* Handles year format (2015), numeric format (6), and "latest".
* Returns null for unknown values to indicate they should use default.
*/
export declare const parseEcmaVersion: (target: string) => Linter.EcmaVersion | null;
/**
* Maps ES target versions to appropriate browser targets for compatibility checking.
* This provides sensible defaults based on when ES features were widely supported.
*/
export declare const getBrowserTargets: (target?: Linter.EcmaVersion | null) => string;
/**
* Convenience function that combines parsing and browser target determination.
* Accepts string input and returns appropriate browser targets.
*/
export declare const getBrowserTargetsFromString: (target: string) => string;
//# sourceMappingURL=getBrowserTargets.d.ts.map