Registry / testing / prettier-config-standard

prettier-config-standard

JSON →
library7.0.0jsnpmunverified

A shareable Prettier configuration that enforces JavaScript Standard Style formatting rules. Version 7.0.0 is the latest stable release, compatible with Prettier ^2.6.0 or ^3.0.0. It explicitly sets Prettier options to match the Standard style, including arrowParens, bracketSameLine, singleAttributePerLine, endOfLine, and JSX quote handling. Unlike directly using Standard, this config works with Prettier as a standalone formatter without ESLint. Updated with each Prettier major release to track option changes and peer dependency ranges.

npm install prettier-config-standard
INSTALL
IMPORT
SIG · PRETTIER-CONFIG-ST
P
prettier-config-standard
testingjavascriptv7.0.0
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 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default (string)
module.exports = 'prettier-config-standard'
module.exports = require('prettier-config-standard')
For `.prettierrc.js` or `prettier.config.js`. The package exports a string, not an object.
default (string)
"prettier": "prettier-config-standard"
"prettier": { "extends": "prettier-config-standard" }
In `package.json`, set the `prettier` key to the string directly.
require for extending
const prettierConfigStandard = require('prettier-config-standard')
import prettierConfigStandard from 'prettier-config-standard'
CommonJS require is used for extending because the module is not ESM.

Installs the shared config and uses it via .prettierrc.js or package.json, then formats a file.

// Install npm install --save-dev prettier prettier-config-standard // .prettierrc.js module.exports = 'prettier-config-standard'; // Or package.json { "name": "my-project", "prettier": "prettier-config-standard", "devDependencies": { "prettier": "^3.0.0", "prettier-config-standard": "^7.0.0" } } // Format a file npx prettier --write src/index.js
Debug
Known issues
breakingIn v4.0.0, arrowParens changed from 'avoid' to 'always'. Code that relied on omitting parentheses around single-parameter arrow functions will now have parentheses added.
fix
Update code to include parentheses on all arrow function parameters, or pin to v3.x if needed.
affects: >=4.0.0
breakingIn v5.0.0, jsxBracketSameLine was replaced with bracketSameLine. Prettier < 2.4.0 is no longer supported. If using Prettier < 2.4.0, this config will cause errors.
fix
Upgrade Prettier to ^2.4.0 or later. If you must use older Prettier, stay on v4.x.
affects: >=5.0.0
breakingIn v3.0.0, endOfLine changed from 'auto' to 'lf'. Windows users may see line ending changes when formatting. Re-cloning the repository may be needed after running Prettier.
fix
Ensure your editor and git config handle LF line endings. Optionally override endOfLine in your own Prettier config.
affects: >=3.0.0
deprecatedVersion 6.0.0 added support for Prettier 3.x. Prettier 2.x is still supported but may eventually drop.
fix
Use Prettier ^3.0.0 if possible; otherwise ensure your Prettier version satisfies '^2.6.0 || ^3.0.0'.
affects: >=6.0.0
gotchaThis config does not install Prettier, Standard, or ESLint. Users often assume it will install Prettier as a dependency.
fix
Ensure you also install Prettier separately: npm install --save-dev prettier
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'prettier-config-standard'
The package is not installed.
fix
Run: npm install --save-dev prettier-config-standard
Cannot read properties of undefined (reading 'someOption') when using require('prettier-config-standard') and merging
The module exports a string, not an object. Using require returns the string, not a config object.
fix
If you want to extend the config, use: const prettierConfigStandard = require('prettier-config-standard') and then reference the string. For merging, use require.resolve('prettier-config-standard') to get the path, or just use the string directly in package.json.
Invalid configuration file: "prettier-config-standard" is not a valid configuration object or string
You may be trying to use the config in a JSON file that expects a different format, or have a syntax error.
fix
Ensure your .prettierrc.json contains exactly "prettier-config-standard". For .prettierrc.js, use module.exports = 'prettier-config-standard';
Upgrade
Version history
7.0.0latest on npm
Audit
Dependencies
prettierrequiredpeer dependency required to use the config
Agent activity
6 hits · last 30 days
node
6
Resources
prettier-config-standard — npm install prettier-config-standard · libregistry