Skip to main content

javascript.biome Submodule

Constructs

Biome

Initializers

import { javascript } from 'projen'

new javascript.biome.Biome(project: NodeProject, options?: BiomeOptions)
NameTypeDescription
project
projen.javascript.NodeProjectNo description.
options
projen.javascript.biome.BiomeOptionsNo description.

projectRequired
  • Type: projen.javascript.NodeProject

optionsOptional
  • Type: projen.javascript.biome.BiomeOptions

Methods

NameDescription
toString
Returns a string representation of this construct.
postSynthesize
Called after synthesis.
preSynthesize
Called before synthesis.
synthesize
Synthesizes files to the project output directory.
addLintPattern
No description.

toString
public toString(): string

Returns a string representation of this construct.

postSynthesize
public postSynthesize(): void

Called after synthesis.

Order is not guaranteed.

preSynthesize
public preSynthesize(): void

Called before synthesis.

synthesize
public synthesize(): void

Synthesizes files to the project output directory.

addLintPattern
public addLintPattern(pattern: string): void
patternRequired
  • Type: string

Static Functions

NameDescription
isConstruct
Checks if x is a construct.
isComponent
Test whether the given construct is a component.
of
No description.

isConstruct
import { javascript } from 'projen'

javascript.biome.Biome.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


isComponent
import { javascript } from 'projen'

javascript.biome.Biome.isComponent(x: any)

Test whether the given construct is a component.

xRequired
  • Type: any

of
import { javascript } from 'projen'

javascript.biome.Biome.of(project: Project)
projectRequired
  • Type: projen.Project

Properties

NameTypeDescription
node
constructs.NodeThe tree node.
project
projen.ProjectNo description.
file
projen.JsonFileBiome configuration file content.
task
projen.TaskBiome task.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


projectRequired
public readonly project: Project;
  • Type: projen.Project

fileRequired
public readonly file: JsonFile;
  • Type: projen.JsonFile

Biome configuration file content.


taskRequired
public readonly task: Task;
  • Type: projen.Task

Biome task.


Structs

BiomeOptions

Initializer

import { javascript } from 'projen'

const biomeOptions: javascript.biome.BiomeOptions = { ... }

Properties

NameTypeDescription
biomeConfig
projen.javascript.biome.biome_config.IConfigurationFull Biome configuration.
formatter
booleanEnable code formatter.
linter
booleanEnable linting.
mergeArraysInConfiguration
booleanShould arrays be merged or overwritten when creating Biome configuration.
organizeImports
booleanEnable import sorting/organizing.
version
stringVersion of Biome to use.

biomeConfigOptional
public readonly biomeConfig: IConfiguration;
  • Type: projen.javascript.biome.biome_config.IConfiguration

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.
formatterOptional
public readonly formatter: boolean;
  • Type: boolean
  • Default: false

Enable code formatter.

Replaces mainly Prettier


linterOptional
public readonly linter: boolean;
  • Type: boolean
  • Default: true

Enable linting.

Replaces Eslint.


mergeArraysInConfigurationOptional
public readonly mergeArraysInConfiguration: boolean;
  • Type: boolean
  • Default: true

Should arrays be merged or overwritten when creating Biome configuration.

By default arrays are merged and duplicate values are removed


organizeImportsOptional
public readonly organizeImports: boolean;
  • Type: boolean
  • Default: false

Enable import sorting/organizing.

Replaces mainly Prettier


versionOptional
public readonly version: string;
  • Type: string
  • Default: "^1"

Version of Biome to use.