@jsenv/prettier-check-project

5.6.1 • Public • Published

Prettier check project

Format staged or project files with prettier.

github package npm package github ci codecov

Table of contents

Presentation

This package was designed to:

  • format staged files with prettier, prefect in a precommit hook.
  • get an overwiew of your files state regarding prettier formatting.
  • format your project files at once.
import { formatWithPrettier } from "@jsenv/prettier-check-project"

formatWithPrettier({
  projectDirectoryUrl: "file:///directory",
})

node terminal screenshot

Installation

npm install @jsenv/prettier-check-project

formatWithPrettier

formatWithPrettier is an async function collecting files to format them with prettier. It also logs progression and return summary and report objects.

import { formatWithPrettier } from "@jsenv/prettier-check-project"

const { summary, report } = await formatWithPrettier({
  logLevel: "debug",
  projectDirectoryUrl: "file:///Users/you/directory",
  prettierIgnoreFileRelativeUrl: ".prettierignore",
  projectFilesConfig: {
    "./src/": true,
    "./*": true,
  },
})

— source code at src/formatWithPrettier.js.

Readme

Keywords

none

Package Sidebar

Install

npm i @jsenv/prettier-check-project

Weekly Downloads

51

Version

5.6.1

License

MIT

Unpacked Size

138 kB

Total Files

13

Last publish

Collaborators

  • dmail
  • jsenv-admin