@mkvlrn/config
v0.5.1
Published
Opinionated configurations for biome and typescript
Maintainers
Readme
@mkvlrn/config
Custom, opinionated configurations that can be used to extend your own biome, typescript, and vitest configs. Or just to serve as sane, strict defaults.
Aimed at modern, type-safe, non-spaghetti codebases in most most node, bun, deno, nest, and react projects without changes, just by extending these configs.
Installation
[!NOTE] This package is hosted both at npm and jsr, and is ESM only.
| Package manager | npm | JSR |
| --------------- | -------------------------------- | ------------------------------------------ |
| Bun | bun add @mkvlrn/config -D | bunx jsr add @mkvlrn/[email protected] -D |
| npm | npm install @mkvlrn/config -D | npx jsr add @mkvlrn/[email protected] -D |
| pnpm | pnpm add @mkvlrn/config -D | pnpm dlx jsr add @mkvlrn/[email protected] -D |
| Yarn | yarn add @mkvlrn/config -D | yarn dlx jsr add @mkvlrn/[email protected] -D |
| Deno | deno add npm:@mkvlrn/config -D | deno add jsr:@mkvlrn/[email protected] -D |
Usage
Obs: Biome, TypeScript, and Vitest need to be installed separately and be available in the project.
biome (biome.json / biome.jsonc)
Create your configuration file:
{
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
"root": true, // if this is the root of your project, false otherwise
"extends": ["@mkvlrn/config/biome"],
"overrides": [
// any overrides, see biome docs
],
}typescript (tsconfig.json)
Create your configuration file:
{
"extends": "@mkvlrn/config/tsconfig",
"compilerOptions": {
// add your custom rules here
},
}Obs: anything related to files needs to be set: rootDir, outDir, baseUrl, paths, etc - this prevents path confusion because the "original" tsconfig will be in node_modules.
vitest (vitest.config.ts)
Create your configuration file:
import { defineConfig, mergeConfig } from "vitest/config";
import baseConfig from "@mkvlrn/config/vitest" with { type: "json" } // attention here, it is a json export
export default mergeConfig(
baseConfig,
defineConfig({
test: {
// custom configs here
},
}),
);The exported configuration is in json format, perfectly usable with mergeConfig.
License
MIT
