npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zapal/dx

v1.2.0

Published

Zapal DX. Set of code quality tools configurations, rule sets and utilities. Prettier, ESLint, TypeScript, Commitlint, etc.

Downloads

34

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

Prettier configurations use prettier-plugin-packagejson and @ianvs/prettier-plugin-sort-imports plugins by default.

  • prettier-plugin-packagejson is used to format package.json files and does not require any additional configuration.
  • @ianvs/prettier-plugin-sort-imports is used to sort imports in TS/JS/React/Vue/Svelte files. It may require an additional configuration to provide the best development experience. Check the plugin's documentation for more information.

The default configuration for @ianvs/prettier-plugin-sort-imports is:

{
  "importOrderTypeScriptVersion": "5.0.0",
  "importOrder": [
    "<BUILTIN_MODULES>",
    "^(@zapal)(/.*)$",
    "<THIRD_PARTY_MODULES>",
    "",
    "^[.]",
    "",
    "^(?!.*[.]css$)[./].*$",
    ".css$"
  ]
}

Using the default configuration:

// package.json
{
  "prettier": "@zapal/dx/prettier"
}
// .prettierrc.js or .prettierrc.mjs
export { default } from '@zapal/dx/prettier'
// .prettierrc.js or .prettierrc.mjs
export { sveltePrettierConfig as default } from '@zapal/dx/prettier'

Using the configuration with some custom options:

// .prettierrc.js or .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.js or eslint.config.mjs
export { default } from '@zapal/dx/eslint'

TypeScript

Available exports:

  • @zapal/dx/typescript - default configuration
  • @zapal/dx/typescript/next - configuration for Next.js, extending the default configuration
  • @zapal/dx/typescript/svelte - configuration for Svelte-based projects, extending the default configuration

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

IMPORTANT: Unfortunately, the commitlint requires you to install extended dependencies directly in your project. Use devDependencies for that.

Here is the list of the required devDependencies for the configurations:

  • Default - @commitlint/config-conventional
  • PNPM Workspace scopes - @commitlint/config-conventional and @commitlint/config-pnpm-scopes

Using the default configuration:

// .commitlintrc.json
{
  "extends": ["@zapal/dx/commitlint"]
}
// commitlint.config.js or commitlint.config.mjs
export { default } from '@zapal/dx/commitlint'

Using the configuration with configuration for PNPM Workspace based scopes:

// commitlint.config.js or commitlint.config.mjs
export { pnpmWorkspaceScopesCommitlintConfig as default } from '@zapal/dx/commitlint'