Skip to content

Repository files navigation

Features

  • Shared presets for OXC tools (oxlint + oxfmt)
  • TypeScript configuration presets
  • CLI for quick project setup

Usage

Important

New/updated rules will not be considered as breaking changes. Only API changes will be considered as breaking changes.

CLI installation

Just run this command in your project root directory:

pnpm dlx @minimalstuff/tooling@latest

Manual install

pnpm add -D oxlint oxfmt @minimalstuff/tooling

OXC (oxlint + oxfmt)

oxlint

// oxlint.config.ts
import { defineConfig } from 'oxlint';
import { minimalstuffPreset } from '@minimalstuff/tooling/oxc/lint';

export default defineConfig({
	extends: [minimalstuffPreset()],
});

Options:

Option Type Default Description
react boolean false Enable React-specific oxlint plugins
adonisjs boolean false Enable AdonisJS-specific rules
perfectionist boolean true Enable import sorting via perfectionist
import {
	ADONISJS_DEFAULT_IGNORE_PATTERNS,
	minimalstuffPreset,
} from '@minimalstuff/tooling/oxc/lint';

export default defineConfig({
	ignorePatterns: [...ADONISJS_DEFAULT_IGNORE_PATTERNS, 'tmp/**'],
	extends: [
		minimalstuffPreset({ react: true, adonisjs: true, perfectionist: true }),
	],
	rules: {
		'no-unused-vars': 'error',
	},
});

oxfmt

// oxfmt.config.ts
import { minimalstuffPreset } from '@minimalstuff/tooling/oxc/fmt';

export default minimalstuffPreset();

You can override any option:

export default minimalstuffPreset({ printWidth: 120, semi: true });

For Adonis projects, you can extend ignore patterns:

import {
	ADONISJS_DEFAULT_IGNORE_PATTERNS,
	minimalstuffPreset,
	OXFMT_DEFAULT_IGNORE_PATTERNS,
} from '@minimalstuff/tooling/oxc/fmt';

export default minimalstuffPreset({
	ignorePatterns: [
		...OXFMT_DEFAULT_IGNORE_PATTERNS,
		...ADONISJS_DEFAULT_IGNORE_PATTERNS,
	],
});

Defaults: printWidth: 100, semi: false, singleQuote: true, trailingComma: 'all', arrowParens: 'avoid'.

Scripts

{
	"scripts": {
		"lint": "oxlint",
		"lint:fix": "oxlint --fix",
		"format": "oxfmt --write ."
	}
}

Tsconfig

Node (ESM):

{
	"extends": "@minimalstuff/tooling/tsconfigs/tsconfig.node",
	"compilerOptions": {
		"rootDir": "./",
		"outDir": "./build"
	}
}

Node Next (ESM + ts extensions):

{
	"extends": "@minimalstuff/tooling/tsconfigs/tsconfig.node-next",
	"compilerOptions": {
		"rootDir": "./",
		"outDir": "./build"
	}
}

React (TSX, bundler resolution):

{
	"extends": "@minimalstuff/tooling/tsconfigs/tsconfig.react",
	"compilerOptions": {
		"rootDir": "./",
		"outDir": "./build"
	}
}

Prerequisites

  1. NPM token Create an automation token at npmjs.com/access-tokens (scope: package publish for @minimalstuff/ui).

  2. Repository secret In the repo: Settings → Secrets and variables → Actions. Add a secret named NPM_TOKEN with the token value.


source: https://github.com/Julien-R44/tooling

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages