{"id":20050,"library":"gatsby-plugin-prettier-eslint","title":"Gatsby Plugin Prettier ESLint","description":"Integrates Prettier and ESLint with Gatsby, automatically formatting and linting files on save or during development. Version 1.0.6 is the latest (no release cadence specified). It runs in watch mode, supports initial full scan, and can be configured to process different file patterns for Prettier and ESLint separately. Unlike other plugins, it requires explicit peer dependency installation (prettier, eslint, gatsby ≥2.0.0) and offers granular control via gatsby-config options. It is ideal for keeping code style consistent during Gatsby development without manual formatting steps.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/andreabreu-me/gatsby-plugin-prettier-eslint","tags":["javascript","gatsby","gatsby-plugin","prettier","eslint","watch"],"install":[{"cmd":"npm install gatsby-plugin-prettier-eslint","lang":"bash","label":"npm"},{"cmd":"yarn add gatsby-plugin-prettier-eslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add gatsby-plugin-prettier-eslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Gatsby plugin runtime peer dependency","package":"gatsby","optional":false},{"reason":"Required for formatting functionality","package":"prettier","optional":false},{"reason":"Required for linting functionality","package":"eslint","optional":false}],"imports":[{"note":"This is a Gatsby plugin, not a standard ES module. It is configured in gatsby-config.js using CommonJS module.exports.","wrong":"import gatsbyPluginPrettierEslint from 'gatsby-plugin-prettier-eslint'","symbol":"default","correct":"module.exports = { plugins: [{ resolve: 'gatsby-plugin-prettier-eslint', options: { ... } }] }"}],"quickstart":{"code":"// Install dependencies\n// npm install prettier eslint gatsby-plugin-prettier-eslint\n\n// gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: 'gatsby-plugin-prettier-eslint',\n      options: {\n        prettier: {\n          patterns: ['**/*.{css,scss,less}', '**/*.{json,json5}', '**/*.{graphql}', '**/*.{md,mdx}', '**/*.{html}', '**/*.{yaml,yml}'],\n        },\n        eslint: {\n          patterns: '**/*.{js,jsx,ts,tsx}',\n          customOptions: { fix: true, cache: true },\n        },\n      },\n    },\n  ],\n};\n","lang":"javascript","description":"Shows minimal gatsby-config setup using gatsby-plugin-prettier-eslint with Prettier for CSS/JSON etc. and ESLint for JS/TS files."},"warnings":[{"fix":"Configure prettier.patterns and eslint.patterns with non-overlapping globs.","message":"Do NOT target the same file patterns with both prettier and eslint options to avoid redundant work or bad behaviour.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set initialScan: false in options to skip initial full scan.","message":"The default initialScan true will format/lint the entire project on Gatsby startup, which may be slow for large projects.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set watch: false in options to disable automatic formatting on save.","message":"watch is true by default, meaning formatting/linting runs on every save. This may cause performance issues or unexpected changes.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider alternative plugins like gatsby-plugin-eslint or manually configure lint-staged/husky.","message":"The package has not been updated since 2021 and may not be compatible with Gatsby v4+ or newer versions of ESLint/Prettier.","severity":"deprecated","affected_versions":"1.0.6"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install prettier","cause":"Missing peer dependency 'prettier'","error":"Cannot find module 'prettier'"},{"fix":"Run: npm install eslint","cause":"Missing peer dependency 'eslint'","error":"Cannot find module 'eslint'"},{"fix":"Run: npm install gatsby-plugin-prettier-eslint. Ensure Gatsby is version 2.x or 3.x.","cause":"Plugin not installed or version incompatible with Gatsby version","error":"The module 'gatsby-plugin-prettier-eslint' is not a valid Gatsby plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}