prettier-config-moon

raw JSON →
1.2.2 verified Sat Apr 25 auth: no javascript

A strict, accessibility-focused Prettier shared configuration from the moonrepo team. Current stable version is 1.2.2, released regularly alongside other moonrepo presets. Key differentiators: enforces tabs over spaces for accessibility, includes arrow parenthesis always, trailing commas, semicolons, single quotes, and spaces for indentation. Minimal dependencies; export is a string reference, not a JavaScript object. Designed for projects using Prettier with Node.js and the moon monorepo toolchain.

error Cannot find module 'prettier-config-moon'
cause Package not installed or not resolvable from the configuration file location.
fix
Install the package as a dev dependency: npm install --save-dev prettier-config-moon
error Invalid configuration file: Expected string, got object
cause Trying to require the package and assign its exports to module.exports instead of using the package name string.
fix
Change to: module.exports = 'prettier-config-moon';
error Error: Could not resolve 'prettier-config-moon' from ...
cause Configuration file path is not in a location where Prettier can resolve the module name.
fix
Place the configuration file (e.g., prettier.config.js) in the project root directory.
gotcha Config is a string, not an object. Do not require or import it as a JavaScript object.
fix Export the package name as a string: module.exports = 'prettier-config-moon';
gotcha Using tabs for indentation may conflict with projects that expect spaces.
fix Override the tabWidth and useTabs options in your local config if needed.
deprecated Version 1.x is stable; no breaking changes reported, but always check peer dependency versions.
fix Ensure prettier peer dependency is compatible. No specific fix needed.
npm install prettier-config-moon
yarn add prettier-config-moon
pnpm add prettier-config-moon

Shows how to extend the shared Prettier config by exporting the package name as a string in a prettier.config.js file.

// prettier.config.js
module.exports = 'prettier-config-moon';