{"id":20056,"library":"gatsby-remark-prettier","title":"gatsby-remark-prettier","description":"A Gatsby remark plugin that formats code blocks in Markdown files using Prettier. Version 1.0.0 is stable but relies on older Gatsby (^1.9.273) and Prettier (^1.13.7) peer dependencies. It integrates with gatsby-transformer-remark and can be configured to use a local .prettierrc file or override options. Unlike manual formatting, it automates code block styling within Gatsby's build pipeline. No longer actively developed.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","gatsby","gatsby-plugin","prettier","remark"],"install":[{"cmd":"npm install gatsby-remark-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add gatsby-remark-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add gatsby-remark-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as the parent transformer to process Markdown files.","package":"gatsby-transformer-remark","optional":false},{"reason":"Peer dependency used to format code blocks.","package":"prettier","optional":false}],"imports":[{"note":"Must be used as a plugin in gatsby-config.js under gatsby-transformer-remark's plugins array, not as a top-level plugin.","wrong":"plugins: ['gatsby-remark-prettier']","symbol":"gatsby-remark-prettier","correct":"{\n  resolve: `gatsby-remark-prettier`,\n  options: {}\n}"},{"note":"Boolean, not string. Defaults to true.","wrong":"options: { usePrettierrc: 'true' }","symbol":"options.usePrettierrc","correct":"options: { usePrettierrc: true }"},{"note":"Accepts Prettier options object. Overrides .prettierrc if usePrettierrc is true.","wrong":"options: { prettierOptions: { singleQuote: true } } (valid but depends on preference)","symbol":"options.prettierOptions","correct":"options: { prettierOptions: { semi: false } }"}],"quickstart":{"code":"// gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-transformer-remark`,\n      options: {\n        plugins: [\n          {\n            resolve: `gatsby-remark-prettier`,\n            options: {\n              usePrettierrc: true,\n              prettierOptions: {\n                semi: false,\n                singleQuote: true\n              }\n            }\n          },\n          `gatsby-remark-prismjs`\n        ]\n      }\n    }\n  ]\n}","lang":"javascript","description":"Configures gatsby-remark-prettier to format code blocks, using .prettierrc and overriding some options, with a highlight plugin after it."},"warnings":[{"fix":"Check peer dependency versions; if using newer Gatsby, look for alternatives or fork.","message":"Requires gatsby@^1.9.273 and prettier@^1.13.7. Not compatible with Gatsby v2+ or prettier v2+.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Place prettier plugin before highlight plugins in the plugins array.","message":"Order matters: gatsby-remark-prettier should be placed before any syntax highlighting plugins like gatsby-remark-prismjs to avoid conflicts.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set `usePrettierrc: false` and specify all options in `prettierOptions` if issues arise.","message":"The `usePrettierrc` option resolves config relative to process.cwd(), which may not be the project root in some Gatsby setups.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':19 '1.13.7':30 '1.9.273':27 'activ':68 'autom':57 'block':12,59 'build':64 'code':11,58 'configur':43 'depend':32 'develop':69 'file':15,49 'format':10,55 'gatsbi':2,6,26,37,62,71,73 'gatsby-plugin':72 'gatsby-remark-pretti':1 'gatsby-transformer-remark':36 'integr':34 'javascript':70 'local':47 'longer':67 'manual':54 'markdown':14 'older':25 'option':52 'overrid':51 'peer':31 'pipelin':65 'plugin':8,74 'prettier':4,17,29,75 'prettierrc':48 'reli':23 'remark':3,7,39,76 'stabl':21 'style':60 'transform':38 'unlik':53 'use':16,45 'version':18 'within':61","created_at":"2026-04-25T11:21:05.954434+00:00","updated_at":"2026-04-25T11:21:05.954434+00:00","problems":[{"fix":"npm install gatsby-remark-prettier","cause":"Plugin not installed or missing in node_modules.","error":"Error: Cannot find module 'gatsby-remark-prettier'"},{"fix":"Move it to the plugins array inside gatsby-transformer-remark options.","cause":"Plugin added to top-level plugins array instead of under gatsby-transformer-remark.","error":"Warning: unknown plugin \"gatsby-remark-prettier\""},{"fix":"npm install prettier@^1.13.7","cause":"prettier peer dependency not installed.","error":"ReferenceError: prettier is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/gatsby-remark-prettier","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}