@billoneta/config v1.0.6
๐ฆ @billoneta/config
๐พ Installation
# Using npm
npm install -D @billoneta/config
# Using yarn
yarn add -D @billoneta/config
# Using pnpm
pnpm add -D @billoneta/config๐ How to use?
๐
changelog-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a changelog file first, changelog.config.ts or .changelogrc.js
!WARNING These are the only files supported at the moment
1. Default config
// changelog.config.js or .changelogrc.js
// @ts-check
import defineConfig from '@billoneta/config/changelog-config';
/** @type {import("@billoneta/config/changelog-config").Config} */
export default defineConfig();2. Custom config
!IMPORTANT ๐ฉ If you have no idea of the config
| Key | Type |
|---|---|
customCommitTypeMap | object |
customScopeMap | object |
displayCommitTypes | array |
displayScopes | array |
showAuthor | boolean |
showAuthorAvatar | boolean |
showSummary | boolean |
withEmoji | boolean |
reduceHeadingLevel | boolean |
newlineTimestamp | boolean |
addBackToTop | boolean |
// changelog.config.js or .changelogrc.js
// @ts-check
import defineConfig from '@billoneta/config/changelog-config';
/** @type {import("@billoneta/config/changelog-config").Config} */
export default defineConfig({
showAuthor: true,
showAuthorAvatar: true,
showSummary: true,
withEmoji: true,
reduceHeadingLevel: true,
newlineTimestamp: true,
addBackToTop: true,
});๐จ commitlint-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a commitlint file first, files config
!IMPORTANT For best preference, I recommend using commitlint.config.js or .commitlint.js
// commitlint.config.js or .commitlint.js
// @ts-check
import commitlintConfig from '@billoneta/config/commitlint-config';
/** @type {import('@commitlint/types').UserConfig} */
export default commitlintConfig;๐ฎ eslint-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a eslint file first, files config
!IMPORTANT For best preference, I recommend using eslint.config.ts or eslint.config.js
๐งฑ Base setup
Kick things off with a solid foundation: essential ESLint rules + Prettier support baked in.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.base]);โก Using it with Next.js
Tailored for Next.js projects โ includes all the recommended rules so you don't have to guess.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.next]);๐ฅ๏ธ For Node.js
Config designed to keep your Node.js code clean and consistent.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.node]);๐งน Prettier integration
Make sure your formatting rules play nice with your linter.
โ Make sure to place this configuration last in your setup to avoid conflicts or unexpected behavior.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([
// ...Other config
eslintConfig.prettier,
]);โ๏ธ For React
Set up linting rules specifically for React apps and components.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.react]);๐ Turbo + Monorepos
Optimized setup for monorepo structures using Turbo โ includes parser and smart rules.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.turbo]);๐ง TypeScript
Config for TypeScript support, including parser and strict rules tailored for typed projects.
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.typescript]);๐ Combining multiple setups
Need to mix configurations? No problem. Just stack them:
// eslint.config.ts
import eslintConfig from '@billoneta/config/eslint-config';
import { defineConfig } from 'eslint/config';
export default defineConfig([eslintConfig.base, eslintConfig.typescript, eslintConfig.react]);!NOTE This section of the module is a fork of IgorKowalczyk/eslint-config, with additional improvements and custom tweaks.
โจ Full credit to him
๐น lefthook-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a lefthook file first, files config
!IMPORTANT For best preference, I recommend using lefthook.json or .lefthook.json
// lefthook.json
{
"$schema": "https://json.schemastore.org/lefthook.json",
"extends": ["node_modules/@billoneta/config/dist/lefthook-config/base.json"]
}๐
ฟ prettier-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a prettier file first, files config
!IMPORTANT For best preference, I recommend using prettier.config.js or .prettierrc.js
// prettier.config.js or .prettierrc.js
// @ts-check
import prettierConfig from '@billoneta/config/prettier-config';
/** @type {import("prettier").Options} */
export default prettierConfig;๐ release-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a semantic release file first, files config
!IMPORTANT For best preference, I recommend using release.config.js or .releaserc.js
1. Default config
// release.config.js or .releaserc.js
// @ts-check
import defineConfig from '@billoneta/config/release-config';
/** @type {import('@billoneta/config/release-config').ReleaseConfigOptions} */
export default defineConfig();2. Custom config
Define your custom config following the Semantic Release Options
!IMPORTANT ๐ฉ How to configure default and customizable plugins
| Plugin | Type | Doc |
|---|---|---|
commitAnalyzer | object | View Commit Analyzer Docs |
exec | object | View Exec Docs |
releaseNotesGenerator | object | View Release Notes Generator Docs |
changelog | object | View Changelog Docs |
npm | object | View NPM Docs |
git | object | View GIT Docs |
github | object | View Github Docs |
!NOTE If you want to add a custom plugin, you can do it by adding the key
plugininside the array you can add as many as you need.
// release.config.js or .releaserc.js
// @ts-check
import defineConfig from '@billoneta/config/release-config';
/** @type {import('@billoneta/config/release-config').ReleaseConfigOptions} */
export default defineConfig({
branches: [
'next',
{
name: 'next',
channel: 'next',
prerelease: true,
},
],
plugin: [],
// Default and customizable plugins
commitAnalyzer: {
releaseRules: [
{ breaking: true, release: 'major' },
{ type: 'feat', release: 'minor' },
{ type: 'feat', scope: 'int-*', release: false },
{ type: 'fix', release: 'patch' },
],
},
npm: {
npmPublish: true,
tarballDir: './path/to/you/dir',
pkgRoot: './path/to/you/root',
},
});โป๏ธ renovate-config
!NOTE A brief explanation of its use and the most recommended one.
You need to create a renovate file first, files config
!IMPORTANT For best preference, I recommend using renovate.json or renovate.json5
// .github/renovate.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>billoneta/kitsune//packages/config/src/renovate-config/base.json"]
}