@zapal/dx
v0.1.2
Published
Zapal DX. Set of code quality tools configurations, rule sets and utilities. Prettier, ESLint, TypeScript, Commitlint, etc.
Downloads
190
Readme
@zapal/dx
Zapal DX (Developer Experience) - opinionated and simple set of code quality tools' configurations, rule sets and utilities, to make your life easier.
Used by Zapal internally, but open-sourced for everyone to use.
Getting started
Tools for which configurations are provided:
- Prettier (
>=3 <4
) - ESLint (
>=9 <10
) - TypeScript (
>=4.8.0 <6
) - Commitlint (
>=19 <20
)
P.S.: The configurations by default may not suit your needs. You can extend them or override them with your own configurations.
IMPORTANT: This package is not contains a tools itself as dependencies, only a set of configurations.
Installation
# pnpm
pnpm add -D @zapal/dx
# npm
npm i -D @zapal/dx
# yarn
yarn add -D @zapal/dx
Usage
All the configurations are available as named exports and default export (the base configurations) from the package subdirectories.
Separate directory for each tool's configurations:
- Prettier:
@zapal/dx/prettier
- ESLint:
@zapal/dx/eslint
- TypeScript:
@zapal/dx/typescript
- Commitlint:
@zapal/dx/commitlint
IMPORTANT: There is no exports from the root of the package, only from the subdirectories.
Prettier
Using the default configuration:
// package.json
{
"prettier": "@zapal/dx/prettier"
}
// .prettierrc.mjs
export { default } from '@zapal/dx/prettier'
// .prettierrc.mjs
export { sveltePrettierConfig as default } from '@zapal/dx/prettier'
Using the configuration with some custom options:
// .prettierrc.mjs
import { defaultPrettierConfig } from '@zapal/dx/prettier'
export default {
...defaultPrettierConfig,
semi: false,
}
ESLint
Principle is the same as for Prettier.
// package.json
{
"eslintConfig": "@zapal/dx/eslint"
}
// eslint.config.mjs
export { default } from '@zapal/dx/eslint'
TypeScript
Using the default configuration:
// tsconfig.json
{
"extends": "@zapal/dx/typescript"
}
Using the configuration for Next.js, for example:
// tsconfig.json
{
"extends": "@zapal/dx/typescript/next"
}
Commitlint
Using the default configuration:
// .commitlintrc.json
{
"extends": ["@zapal/dx/commitlint"]
}
// commitlint.config.mjs
export { default } from '@zapal/dx/commitlint'
Using the configuration with configuration for PNPM Workspace based scopes:
// commitlint.config.mjs
export { pnpmWorkspaceScopesCommitlintConfig as default } from '@zapal/dx/commitlint'