{"id":20461,"library":"prettier-standard","title":"prettier-standard","description":"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.","status":"active","version":"16.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/sheerun/prettier-standard","tags":["javascript","prettier","eslint","standard","linting","formatting"],"install":[{"cmd":"npm install prettier-standard","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-standard","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-standard","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is a CLI tool; programmatic usage is not officially supported. If you need to use it as a module, prefer ESM import.","wrong":"const prettierStandard = require('prettier-standard')","symbol":"default","correct":"import prettierStandard from 'prettier-standard'"},{"note":"If you import programmatically, the main function is named 'run'. Check the source for exports.","wrong":"import run from 'prettier-standard'","symbol":"run","correct":"import { run } from 'prettier-standard'"},{"note":"Available since v12.0.0. Use named import for programmatic access.","wrong":"const { formatFiles } = require('prettier-standard')","symbol":"formatFiles","correct":"import { formatFiles } from 'prettier-standard'"}],"quickstart":{"code":"// Install globally or locally\nnpm install -g prettier-standard\n\n// Format all files in project and lint\nprettier-standard --lint\n\n// Format only staged files (for precommit hooks)\nprettier-standard --staged\n\n// Format changed lines since master\nprettier-standard --changed --since master\n\n// Use as a lint-staged step in package.json\n\"lint-staged\": {\n  \"*.{js,jsx,ts,tsx,css}\": [\"prettier-standard --lint\"]\n}","lang":"javascript","description":"Shows typical CLI usage: global/local install, formatting with linting, staged files, and git-aware formatting."},"warnings":[{"fix":"If you relied on standard --fix behavior, you may need to check formatting differences. Custom configuration now goes in .prettierrc, not .eslintrc.","message":"Since v9.0.0, prettier-standard no longer passes code through 'standard --fix'. It uses prettierx instead.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Move any eslint-based formatting config to .prettierrc. Extend 'prettier' and 'prettier/standard' in .eslintrc for linting.","message":"Since v9.0.0, custom configuration happens through .prettierrc instead of .eslintrc. Output matches prettier output.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"Avoid using --lines if possible. Use --changed or --staged instead.","message":"--lines flag is experimental; prettier has known issues with range formatting (prettier#4926, prettier#6428).","severity":"gotcha","affected_versions":">=13.0.0"},{"fix":"If you need exact prettier formatting, use prettier directly and configure eslint separately.","message":"This package uses prettierx, not upstream prettier. Formatting may differ slightly from prettier.","severity":"gotcha","affected_versions":">=9.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install prettier-standard' or 'yarn add prettier-standard' (devDependency).","cause":"Package not installed or not in node_modules","error":"Error: Cannot find module 'prettier-standard'"},{"fix":"Install globally: 'npm install -g prettier-standard', or use npx: 'npx prettier-standard'.","cause":"Package not installed globally or not in PATH","error":"prettier-standard: command not found"},{"fix":"Ensure the file has a recognized extension (.js, .jsx, .ts, .tsx, .css, etc.) or use --parser flag.","cause":"Trying to format a file with an unsupported extension or syntax","error":"SyntaxError: Unexpected token (1:1) while parsing /path/to/file"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}