javascript.biome
Submodule
Constructs
Biome
Initializers
import { javascript } from 'projen'
new javascript.biome.Biome(project: NodeProject, options?: BiomeOptions)
Name | Type | Description |
---|---|---|
| projen.javascript.NodeProject | No description. |
| projen.javascript.biome.BiomeOptions | No description. |
project
Required
- Type: projen.javascript.NodeProject
options
Optional
- Type: projen.javascript.biome.BiomeOptions
Methods
Name | Description |
---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| 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
pattern
Required
- Type: string
Static Functions
Name | Description |
---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
| 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.
x
Required
- Type: any
Any object.
isComponent
import { javascript } from 'projen'
javascript.biome.Biome.isComponent(x: any)
Test whether the given construct is a component.
x
Required
- Type: any
of
import { javascript } from 'projen'
javascript.biome.Biome.of(project: Project)
project
Required
- Type: projen.Project
Properties
Name | Type | Description |
---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| projen.JsonFile | Biome configuration file content. |
| projen.Task | Biome task. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
project
Required
public readonly project: Project;
- Type: projen.Project
file
Required
public readonly file: JsonFile;
- Type: projen.JsonFile
Biome configuration file content.
task
Required
public readonly task: Task;
- Type: projen.Task
Biome task.
Structs
BiomeOptions
Initializer
import { javascript } from 'projen'
const biomeOptions: javascript.biome.BiomeOptions = { ... }
Properties
Name | Type | Description |
---|---|---|
| projen.javascript.biome.biome_config.IConfiguration | Full Biome configuration. |
| boolean | Enable code formatter. |
| boolean | Enable linting. |
| boolean | Should arrays be merged or overwritten when creating Biome configuration. |
| boolean | Enable import sorting/organizing. |
| string | Version of Biome to use. |
biomeConfig
Optional
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.
formatter
Optional
public readonly formatter: boolean;
- Type: boolean
- Default: false
Enable code formatter.
Replaces mainly Prettier
linter
Optional
public readonly linter: boolean;
- Type: boolean
- Default: true
Enable linting.
Replaces Eslint.
mergeArraysInConfiguration
Optional
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
organizeImports
Optional
public readonly organizeImports: boolean;
- Type: boolean
- Default: false
Enable import sorting/organizing.
Replaces mainly Prettier
version
Optional
public readonly version: string;
- Type: string
- Default: "^1"
Version of Biome to use.