1. @html-validate/prettier-config
Prettier sharable config used by the various HTML-validate packages
@html-validate/prettier-config
Package: @html-validate/prettier-config
Created by: html-validate
Last modified: Sun, 11 Feb 2024 04:04:57 GMT
Version: 2.4.12
License: MIT
Downloads: 12,886
Repository: git+https://gitlab.com/html-validate/prettier-config.git

Install

npm install @html-validate/prettier-config
yarn add @html-validate/prettier-config

@html-validate/prettier-config

HTML-Validate prettier config.

Install

npm install --save-dev @html-validate/prettier-config

Usage

npm pkg set prettier="@html-validate/prettier-config"
npm pkg set scripts.prettier:check="prettier --check ."
npm pkg set scripts.prettier:write="prettier --write ."

Or manually edit package.json:

 {
  "scripts": {
    "prettier:check": "prettier --check .",
    "prettier:write": "prettier --write ."
  },
  "prettier": "@html-validate/prettier-config"
}

Prettier does not need to be installed separately, this package includes prettier and its binary.

lint-staged

To use lint-staged (included) configure the pre-commit hook to run husky with the --config flag:

 #!/bin/sh

configfile=$(node -p 'require.resolve("@html-validate/prettier-config/lint-staged")')
exec npm exec lint-staged -- --config "${configfile}"

Lint-staged does not need to be installed separately, this package includes lint-staged and its binary.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code