0.2.1 • Published 6 months ago

cdfzo v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

cdfzo/npm

My personal linting/formatting configuration for TypeScript projects using Bun. This is very specific to my needs, but you can use it if you want. It only works on Unix-like systems and without JSX.

Prerequisites

Installation

  1. Run bun a -d cdfzo
  2. Run bunx cdfzo setup

Usage

Following options are available:

  • Default: All created/modified files in this branch (uses git diff main)
  • -a: All files tracked by Git (uses git ls-files)
  • -f: Automatically fix problems (e.g. eslint --fix)

Following linters are executed by default (in this order):

  • p/prettier: Prettier
  • e/eslint: ESLint

Here are some examples of how to use it:

  • bunx cdfzo: Run all linters, but only on modified files
  • bunx cdfzo -f: Fix or format modified files
  • bunx cdfzo eslint prettier: Run ESLint and Prettier
  • bunx cdfzo -a prettier: Check all files with Prettier
  • bunx cdfzo -fa p: Format all files with Prettier (shorthand)

Overriding the Configuration

Please do not rename any of the configuration files. If you really want to change the configuration, you can override it in the following way:

Prettier: You can modify the .prettierrc.json directly.

ESLint: You can override eslint and typescript-eslint rules in the eslint.config.ts like this:

export default [config, { rules: { 'no-undef': 0 } }]

Note

This package already includes @types/bun, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint, prettier, and typescript. You don't have to add them separately.