Skip to content
crutchcrewPublic

About

js/ts tooling configs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

configg ⚙️

CI npm version provenance license

Shared configuration presets for typescript tooling. One package per tool, or all of them in a single install.

The presets ship as TypeScript and JSON source. There is no build step, so use them from a runtime or tool that can load .ts files from node_modules (Bun, or the tool's own loader).

Packages

Package Version What it configures
@configg/oxc npm oxfmt (/fmt) and oxlint (/lint) presets
@configg/tsconfig npm Strictest tsconfig presets for Bun and Vite
@configg/bases (this repo's root) npm All of the above under one name, straight from packages/*

Install only what you use, or install @configg/bases and import everything from it:

@configg/bases/… Same as
oxfmt @configg/oxc/fmt
oxlint @configg/oxc/lint
tsconfig/{bun,client,vite} @configg/tsconfig/{bun,client,vite}

Usage

Tools are peerDependencies: you install oxfmt, oxlint and typescript yourself and pin the versions you want. The packages only supply the presets.

bun add -d @configg/bases oxfmt oxlint oxlint-tsgolint typescript
// oxfmt.config.ts
import { defineConfig } from 'oxfmt'
import { configs } from '@configg/bases/oxfmt'

export default defineConfig(configs.client)
// oxlint.config.ts
import { defineConfig } from 'oxlint'
import { configs } from '@configg/bases/oxlint'

export default defineConfig(configs.client)
// tsconfig.json
{ "extends": "@configg/bases/tsconfig/client" }

Installing a single package works the same way, for example @configg/oxc/fmt and @configg/oxc/lint.

Presets

  • oxfmt exports configs: client (Tailwind class sorting, import grouping), scripts (shared base for tooling and config files) and server (shared base).
  • oxlint exports configs: client (browser env, React, and a **/*.spec.{ts,tsx} override with Vitest and Testing Library rules) and scripts (Node env).
  • tsconfig/bun (strictest + Bun), tsconfig/vite (strictest + Vite/React) and tsconfig/client (vite with ambient types cleared, so a package only picks up the @types/* it asks for).

The Oxlint presets don't enable anti-slop. antiSlop from the oxlint entry is an opt-in set with the plugin and all 18 rules as errors; unicorn/prefer-reflect-apply is off. See UPSTREAM.md for its source and update policy.

import { antiSlop, configs } from '@configg/bases/oxlint'

export default defineConfig({
	...configs.client,
	jsPlugins: [...antiSlop.jsPlugins],
	rules: { ...configs.client.rules, ...antiSlop.rules },
})

If your config has its own jsPlugins, keep the anti-slop entry in that array. The plugin ships as TypeScript, so run oxlint under Bun (bunx --bun oxlint): Node refuses to strip types from files in node_modules.

eslint-plugin-testing-library is only needed for configs.client in the oxlint preset.

Development

The repo uses its own packages through the workspace, so there is nothing to build.

bun install
bun run check      # fmt + lint (with type-check) + lockfile, in parallel

License

MIT

About

js/ts tooling configs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages