Registry / devops / prettier-config-halo-lab

prettier-config-halo-lab

JSON →
library1.0.7jsnpmunverified

A shared Prettier configuration by Halo Lab development team that enforces consistent code formatting across projects. Version 1.0.7 is the latest stable release; the project is maintained on a best-effort basis with irregular updates. Key differentiators: includes import ordering via @trivago/prettier-plugin-sort-imports with a specific 5-group rule (node_modules, @/, ./ non-asset, assets, CSS/SCSS). Requires Prettier and the sort-imports plugin as peer dependencies.

npm install prettier-config-halo-lab
INSTALL
IMPORT
SIG · PRETTIER-CONFIG-HA
P
prettier-config-halo-lab
devopsjavascriptv1.0.7
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.

Config (default)
In package.json: "prettier": "prettier-config-halo-lab"
Using require or import in JS code: const config = require('prettier-config-halo-lab')
This package is a JSON config, not a JavaScript module. Use prettier key in package.json or reference in .prettierrc.
Node.js require (misuse)
In .prettierrc.js: module.exports = require('prettier-config-halo-lab');
In .prettierrc: "prettier": "prettier-config-halo-lab" (actually correct, but often confused with JS require pattern)
For JS config files, use module.exports or export default. For JSON config, use string reference.
TypeScript import (misuse)
TypeScript not needed; config is JSON.
import config from 'prettier-config-halo-lab';
Package does not export TypeScript types; do not import in TS files.

Install dependencies and configure Prettier to use shared config with import sorting.

// package.json { "scripts": { "format": "prettier --write ." }, "prettier": "prettier-config-halo-lab", "devDependencies": { "prettier": "^3.0.0", "prettier-config-halo-lab": "^1.0.7", "@trivago/prettier-plugin-sort-imports": "^4.0.0" } } // Then run: npm run format
Debug
Known issues
breakingImport order groups are predefined and cannot be overridden. If your project uses different import patterns (e.g., '@/something' for aliases), they must match the exact order defined in the plugin.
fix
Review the 5-group order in the README and adjust your import style accordingly.
affects: >=1.0.0
gotchaThe @trivago/prettier-plugin-sort-imports plugin must be installed and present in your package.json devDependencies. This config does NOT include it as a dependency; it's a peer dependency.
fix
Run: npm install --save-dev @trivago/prettier-plugin-sort-imports
affects: >=1.0.0
deprecatedPrettier v3 changed its plugin loading mechanism. The @trivago/prettier-plugin-sort-imports plugin may require specific configuration for Prettier v3.
fix
Use Prettier v2 or check plugin compatibility; see @trivago/prettier-plugin-sort-imports docs for v3 setup.
affects: >=1.0.0
gotchaThe config is a JSON string reference. If you try to extend it via .prettierrc.js using spread or require, it will not merge correctly unless you use module.exports = { ...require('prettier-config-halo-lab'), ...yourOverrides }.
fix
In .prettierrc.js: module.exports = { ...require('prettier-config-halo-lab'), semi: true };
affects: >=1.0.0
gotchaThe import sorting plugin's `importOrder` option is hardcoded. You cannot customize group ordering without forking the config.
fix
If you need different order, create your own Prettier config instead of extending this one.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-config-halo-lab'
Missing devDependency
fix
npm install --save-dev prettier-config-halo-lab
Error: Cannot find module '@trivago/prettier-plugin-sort-imports'
Missing required plugin
fix
npm install --save-dev @trivago/prettier-plugin-sort-imports
TypeError: Cannot read properties of undefined (reading 'parsers')
Prettier v3 incompatible plugin
fix
Downgrade Prettier to v2 or update plugin to compatible version (e.g., @trivago/prettier-plugin-sort-imports@4)
[prettier] Invalid configuration file: JSON Error in .prettierrc
Using JavaScript object syntax in a JSON file
fix
If using .prettierrc (JSON), ensure content is valid JSON string: "prettier-config-halo-lab". If using .prettierrc.js, use module.exports = 'prettier-config-halo-lab';
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies
prettierrequiredpeer dependency
@trivago/prettier-plugin-sort-importsrequiredrequired for import sorting
Agent activity
8 hits · last 30 days
node
8
Resources