Registry / devops / prettier-standard

prettier-standard

JSON →
library16.4.1jsnpmunverified

Prettier-standard is a CLI tool that combines prettierx (a prettier fork) for code formatting with eslint preconfigured with the standard ruleset. Current version 16.4.1 (requires Node >=8) wraps prettierx and eslint to format and optionally lint JavaScript/TypeScript/CSS files. It simplifies setup by eliminating separate eslint config for whitespace, and provides flags like --staged, --changed, --since for git-aware formatting. Since v9.0.0, it uses .prettierrc for config instead of .eslintrc, and v12.0.0 was a complete rewrite without spawning subprocesses, improving speed. It is well-suited for teams wanting standard-compliant code with minimal configuration, but note that it uses prettierx, not upstream prettier, and may have slight formatting differences.

npm install prettier-standard
INSTALL
IMPORT
SIG · PRETTIER-STANDARD
P
prettier-standard
devopsjavascriptv16.4.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import prettierStandard from 'prettier-standard'
const prettierStandard = require('prettier-standard')
The package is a CLI tool; programmatic usage is not officially supported. If you need to use it as a module, prefer ESM import.
run
import { run } from 'prettier-standard'
import run from 'prettier-standard'
If you import programmatically, the main function is named 'run'. Check the source for exports.
formatFiles
import { formatFiles } from 'prettier-standard'
const { formatFiles } = require('prettier-standard')
Available since v12.0.0. Use named import for programmatic access.

Shows typical CLI usage: global/local install, formatting with linting, staged files, and git-aware formatting.

// Install globally or locally npm install -g prettier-standard // Format all files in project and lint prettier-standard --lint // Format only staged files (for precommit hooks) prettier-standard --staged // Format changed lines since master prettier-standard --changed --since master // Use as a lint-staged step in package.json "lint-staged": { "*.{js,jsx,ts,tsx,css}": ["prettier-standard --lint"] }
prettier-standard --version
Debug
Known issues
breakingSince v9.0.0, prettier-standard no longer passes code through 'standard --fix'. It uses prettierx instead.
fix
If you relied on standard --fix behavior, you may need to check formatting differences. Custom configuration now goes in .prettierrc, not .eslintrc.
affects: >=9.0.0
breakingSince v9.0.0, custom configuration happens through .prettierrc instead of .eslintrc. Output matches prettier output.
fix
Move any eslint-based formatting config to .prettierrc. Extend 'prettier' and 'prettier/standard' in .eslintrc for linting.
affects: >=9.0.0
gotcha--lines flag is experimental; prettier has known issues with range formatting (prettier#4926, prettier#6428).
fix
Avoid using --lines if possible. Use --changed or --staged instead.
affects: >=13.0.0
gotchaThis package uses prettierx, not upstream prettier. Formatting may differ slightly from prettier.
fix
If you need exact prettier formatting, use prettier directly and configure eslint separately.
affects: >=9.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-standard'
Package not installed or not in node_modules
fix
Run 'npm install prettier-standard' or 'yarn add prettier-standard' (devDependency).
prettier-standard: command not found
Package not installed globally or not in PATH
fix
Install globally: 'npm install -g prettier-standard', or use npx: 'npx prettier-standard'.
SyntaxError: Unexpected token (1:1) while parsing /path/to/file
Trying to format a file with an unsupported extension or syntax
fix
Ensure the file has a recognized extension (.js, .jsx, .ts, .tsx, .css, etc.) or use --parser flag.
Upgrade
Version history
16.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
prettier-standard — npm install prettier-standard · libregistry