import type * as TEslint from 'eslint'; import type * as TEslintLegacy from 'eslint-8'; export interface ISerifFormatterOptions { ignoreSuppressed: boolean; eslintVersion?: string; buildFolderPath: string; } export interface ISarifRun { tool: { driver: { name: string; informationUri: string; version?: string; rules: IStaticAnalysisRules[]; }; }; artifacts?: ISarifFile[]; results?: ISarifRepresentation[]; invocations?: { toolConfigurationNotifications: ISarifRepresentation[]; executionSuccessful: boolean; }[]; } export interface ISarifRepresentation { level: string; message: { text: string; }; locations: ISarifLocation[]; ruleId?: string; ruleIndex?: number; descriptor?: { id: string; }; suppressions?: ISuppressedAnalysis[]; } export interface ISarifLog { version: string; $schema: string; runs: ISarifRun[]; } export interface IRegion { startLine?: number; startColumn?: number; endLine?: number; endColumn?: number; snippet?: { text: string; }; } export interface IStaticAnalysisRules { id: string; name?: string; shortDescription?: { text: string; }; fullDescription?: { text: string; }; defaultConfiguration?: { level: 'note' | 'warning' | 'error'; }; helpUri?: string; properties?: { category?: string; precision?: 'very-high' | 'high' | 'medium' | 'low'; tags?: string[]; problem?: { severity?: 'recommendation' | 'warning' | 'error'; securitySeverity?: number; }; }; } export interface ISarifFile { location: { uri: string; }; } export interface ISuppressedAnalysis { kind: string; justification: string; } export interface ISarifLocation { physicalLocation: ISarifPhysicalLocation; } export interface ISarifArtifactLocation { uri: string; index?: number; } export interface ISarifPhysicalLocation { artifactLocation: ISarifArtifactLocation; region?: IRegion; } export interface ISarifRule { id: string; helpUri?: string; shortDescription?: { text: string; }; properties?: { category?: string; }; } /** * Converts ESLint results into a SARIF (Static Analysis Results Interchange Format) log. * * This function takes in a list of ESLint lint results, processes them to extract * relevant information such as errors, warnings, and suppressed messages, and * outputs a SARIF log which conforms to the SARIF v2.1.0 specification. * * @param results - An array of lint results from ESLint that contains linting information, * such as file paths, messages, and suppression details. * @param rulesMeta - An object containing metadata about the ESLint rules that were applied during the linting session. * The keys are the rule names, and the values are rule metadata objects * that describe each rule. This metadata typically includes: * - `docs`: Documentation about the rule. * - `fixable`: Indicates whether the rule is fixable. * - `messages`: Custom messages that the rule might output when triggered. * - `schema`: The configuration schema for the rule. * This metadata helps in providing more context about the rules when generating the SARIF log. * @param options - An object containing options for formatting: * - `ignoreSuppressed`: Boolean flag to decide whether to ignore suppressed messages. * - `eslintVersion`: Optional string to include the version of ESLint in the SARIF log. * @returns The SARIF log containing information about the linting results in SARIF format. */ export declare function formatEslintResultsAsSARIF(results: (TEslint.ESLint.LintResult | TEslintLegacy.ESLint.LintResult)[], rulesMeta: (TEslint.ESLint.LintResultData | TEslintLegacy.ESLint.LintResultData)['rulesMeta'], options: ISerifFormatterOptions): ISarifLog; //# sourceMappingURL=SarifFormatter.d.ts.map