Registry / devops / prettier-config-silverwind

prettier-config-silverwind

JSON →
library2.0.1jsnpmunverified

Shared Prettier configuration package by silverwind. Current stable version is 2.0.1, released irregularly, with peer dependency on Prettier. It provides a function-based API that automatically detects a project's TypeScript, JSX, and other file types to apply sensible defaults. Key differentiator: uses `import.meta.url` for configuration, enabling dynamic per-project overrides without manual file extension handling. Supports Node >=22 and ESM-only with TypeScript type definitions included.

npm install prettier-config-silverwind
INSTALL
IMPORT
SIG · PRETTIER-CONFIG-SI
P
prettier-config-silverwind
devopsjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

silverwind
import silverwind from 'prettier-config-silverwind'
const silverwind = require('prettier-config-silverwind')
Package is ESM-only; CommonJS require() will fail.
silverwind (default export, used as function)
export default silverwind({url: import.meta.url})
export default silverwind()
The function expects an options object with a `url` property using `import.meta.url`. Omitting `url` may cause incorrect path resolution.
silverwind (with custom overrides)
import silverwind from 'prettier-config-silverwind'; export default { ...silverwind({url: import.meta.url}), semi: false }
export default silverwind({url: import.meta.url}, {semi: false})
The function does not accept a second parameter; spread the result to override settings.

Creates a Prettier configuration file using the shared config. The function automatically detects project settings via import.meta.url.

// .prettierrc.js import silverwind from 'prettier-config-silverwind'; export default silverwind({url: import.meta.url});
Debug
Known issues
breakingESM-only since v1.0.0
fix
Ensure your project uses ES modules (type: 'module' in package.json) and use import syntax instead of require().
affects: >=1.0.0
breakingNode.js >=22 required as of v2.0.0
fix
Upgrade Node.js to version 22 or later.
affects: >=2.0.0
gotchaThe function expects `import.meta.url` to be passed explicitly; omitting it leads to undefined behavior.
fix
Always pass {url: import.meta.url} to the function.
affects: >=1.0.0
deprecatedVersions <2.0.0 used a plain export object without function. Function call introduced in v2.
fix
Migrate to function syntax: import silverwind from 'prettier-config-silverwind' and call it with {url: import.meta.url}.
affects: <2.0.0
Errors
Common errors & fixes
Cannot find module 'prettier-config-silverwind'
Package is not installed or not in node_modules.
fix
Run npm install prettier-config-silverwind prettier --save-dev
Must use import to load ES Module: /path/to/project/.prettierrc.js
The config file is treated as CommonJS, but the package is ESM-only.
fix
Add 'type': 'module' to package.json or rename the config file to .prettierrc.mjs
silverwind is not a function
Attempted to call default export as a function but imported incorrectly (e.g., named import).
fix
Use default import: import silverwind from 'prettier-config-silverwind' instead of named import.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
prettierrequiredpeer dependency – required for prettier configuration to be used
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-config-silverwind — npm install prettier-config-silverwind · libregistry