1.0.0 • Published 8 months ago

@packlify/config-format v1.0.0

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

@packlify/config-format

Part of the Packlify Web SDK ecosystem, @packlify/config-format is a package that manages code formatting using Prettier and additional plugins. It comes with command line utilities to both check and write code formats.

Table of Contents

Installation

Install the package using npm or yarn:

npm install @packlify/config-format

Features

@packlify/config-format offers:

  • Command line utilities for format checking and writing.
  • Shared Prettier configuration to enforce consistent styling.
  • Support for sorting import statements using a Prettier plugin.
  • A vibrant and informative console output using chalk.

Dependencies

The package relies on the following key dependencies:

  • chalk: For colored console output.
  • prettier: For code formatting.
  • Additional Prettier plugins for specialized formatting.

Usage

TypeScript (ESM)

The package provides two CLI utilities: packlify-format-check and packlify-format-write.

packlify-format-check

The CLI utility checks for code formatting issues. It scans .js, .jsx, .ts, and .tsx files within the src folder:

npx packlify-format-check

packlify-format-write

This CLI utility writes the code formatting fixes to .js, .jsx, .ts, and .tsx files within the src folder:

npx packlify-format-write

Prettier Configuration

The package comes with a pre-configured Prettier setup, specified in prettier.config.cjs. The following rules are set by default:

  • trailingComma: 'es5'
  • printWidth: 120
  • arrowParens: 'avoid'
  • singleQuote: true

Additional rules related to import sorting are also configured.

const prettierConfig = require('@packlify/config-format/prettier.config.cjs');

module.exports = {
  ...config,
  // ...You can add here also your configurations
};

Contact

Lucas Farias lukf95@gmail.com LinkedIn - GitHub

1.0.0

8 months ago

0.1.2-alpha.1

8 months ago

0.1.2-alpha.0

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.15

8 months ago

0.0.14

9 months ago

0.0.14-alpha.0

9 months ago

0.0.13

9 months ago

0.0.13-alpha.0

9 months ago

0.0.12-alpha.0

9 months ago