0.10.0 • Published 1 year ago
@ninjutsu-build/biome v0.10.0
biome - Ninjutsu Build
A package to create a ninjutsu-build rule for linting and formatting files With
Biome.
Installation
Most likely you require both @ninjutsu-build/biome and @ninjutsu-build/code as a
devDependency, which can be achieved by running the following npm command:
$ npm install @ninjutsu-build/core @ninjutsu-build/biome --save-devBasic Example
The following formats all *.test.js files in the tests directory, and then
runs those tests with node's test runner, while linting those JavaScript files
in parallel.
import { NinjaBuilder } from "@ninjutsu-build/core";
import { makeFormatRule, makeLintRule } from "@ninjutsu-build/biome";
import { makeNodeTestRule } from "@ninjutsu-build/node";
import { writeFileSync } from "fs";
// Create a `NinjaBuilder` requiring 1.11 (for validations)
const ninja = new NinjaBuilder({
ninja_required_version: "1.11",
builddir: ".mybuilddir",
});
// Create our rules
const format = makeFormatRule(ninja);
const lint = makeLintRule(ninja);
const test = makeNodeTestRule(ninja);
const biomeConfig = "biome.json",
// For each test file, format, lint, and run it in node
for (const js of globSync("tests/*.test.js", { posix: true })) {
const formatted = format({ in: js, configPath: biomeConfig });
const linted = lint({ in: formatted, configPath: biomeConfig });
test({
in: linted,
out: `$builddir/results/${js}.txt`,
});
};
// Write the ninja file to disk
writeFileSync("build.ninja", ninja.output);0.10.0
1 year ago
0.9.0
1 year ago
0.8.3
2 years ago
0.8.2
2 years ago
0.8.1
2 years ago
0.8.0
2 years ago
0.7.5
2 years ago
0.7.4
2 years ago
0.7.3
2 years ago
0.7.2
2 years ago
0.7.1
2 years ago
0.7.0
2 years ago
0.6.2
2 years ago
0.6.1
2 years ago
0.6.0
2 years ago
0.5.0
2 years ago
0.4.0
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago