UNPKG

projen

Version:

CDK for software projects

68 lines (67 loc) 1.98 kB
import type { IConfiguration } from "./biome-config"; import { Component } from "../../component"; import type { NodeProject } from "../../javascript/node-project"; import { JsonFile } from "../../json"; import type { Project } from "../../project"; import type { Task } from "../../task"; export interface BiomeOptions { /** * Version of Biome to use * * @default "^1" */ readonly version?: string; /** * Enable linting. Replaces Eslint. * * @default true */ readonly linter?: boolean; /** * Enable code formatter. Replaces mainly Prettier * * @default false */ readonly formatter?: boolean; /** * Enable import sorting/organizing. Replaces mainly Prettier * * @default false */ readonly organizeImports?: boolean; /** * Should arrays be merged or overwritten when creating Biome configuration * * By default arrays are merged and duplicate values are removed * * @default true */ readonly mergeArraysInConfiguration?: boolean; /** * Full Biome configuration. Note that this configuration dictates the final outcome if value is set. * * @example if linter is disabled on main level, it can be enabled on fullConfiguration.formatter.enabled. */ readonly biomeConfig?: IConfiguration; } export declare class Biome extends Component { static of(project: Project): Biome | undefined; private readonly biomeConfiguration; private readonly _lintPatterns; private readonly biomeCommand; /** * Biome task. */ readonly task: Task; /** * Biome configuration file content */ readonly file: JsonFile; constructor(project: NodeProject, options?: BiomeOptions); /** * Update the task with the current list of lint patterns and file extensions */ private updateTask; addLintPattern(pattern: string): void; private createLocalBiomeTask; }