{"id":20301,"library":"prettier-config-moon","title":"prettier-config-moon","description":"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.","status":"active","version":"1.2.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/moonrepo/dev","tags":["javascript","prettier","config","moon"],"install":[{"cmd":"npm install prettier-config-moon","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-config-moon","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-config-moon","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to apply formatting","package":"prettier","optional":false}],"imports":[{"note":"The config is a string reference, not a JavaScript object. Common mistake is to require or import it as an object.","wrong":"module.exports = require('prettier-config-moon');","symbol":"default","correct":"module.exports = 'prettier-config-moon';"},{"note":"In a .prettierrc.js or prettier.config.js file, export the package name as a string.","symbol":"prettier/prettier.config","correct":"module.exports = 'prettier-config-moon';"},{"note":"In JSON .prettierrc, use a plain string, not an 'extends' key. The extends key is not supported by Prettier.","wrong":"{\"extends\": \"prettier-config-moon\"}","symbol":".prettierrc","correct":"\"prettier-config-moon\""}],"quickstart":{"code":"// prettier.config.js\nmodule.exports = 'prettier-config-moon';","lang":"javascript","description":"Shows how to extend the shared Prettier config by exporting the package name as a string in a prettier.config.js file."},"warnings":[{"fix":"Export the package name as a string: module.exports = 'prettier-config-moon';","message":"Config is a string, not an object. Do not require or import it as a JavaScript object.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Override the tabWidth and useTabs options in your local config if needed.","message":"Using tabs for indentation may conflict with projects that expect spaces.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure prettier peer dependency is compatible. No specific fix needed.","message":"Version 1.x is stable; no breaking changes reported, but always check peer dependency versions.","severity":"deprecated","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the package as a dev dependency: npm install --save-dev prettier-config-moon","cause":"Package not installed or not resolvable from the configuration file location.","error":"Cannot find module 'prettier-config-moon'"},{"fix":"Change to: module.exports = 'prettier-config-moon';","cause":"Trying to require the package and assign its exports to module.exports instead of using the package name string.","error":"Invalid configuration file: Expected string, got object"},{"fix":"Place the configuration file (e.g., prettier.config.js) in the project root directory.","cause":"Configuration file path is not in a location where Prettier can resolve the module name.","error":"Error: Could not resolve 'prettier-config-moon' from ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}