Registry / testing / gatsby-plugin-prettier-eslint

gatsby-plugin-prettier-eslint

JSON →
library1.0.6jsnpmunverified

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.

npm install gatsby-plugin-prettier-eslint
INSTALL
IMPORT
SIG · GATSBY-PLUGIN-PRET
G
gatsby-plugin-prettier-eslint
testingjavascriptv1.0.6
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ module.exports = { plugins: [{ resolve: 'gatsby-plugin-prettier-eslint', options: { ... } }] }
✗ import gatsbyPluginPrettierEslint from 'gatsby-plugin-prettier-eslint'
This is a Gatsby plugin, not a standard ES module. It is configured in gatsby-config.js using CommonJS module.exports.

Shows minimal gatsby-config setup using gatsby-plugin-prettier-eslint with Prettier for CSS/JSON etc. and ESLint for JS/TS files.

// Install dependencies // npm install prettier eslint gatsby-plugin-prettier-eslint // gatsby-config.js module.exports = { plugins: [ { resolve: 'gatsby-plugin-prettier-eslint', options: { prettier: { patterns: ['**/*.{css,scss,less}', '**/*.{json,json5}', '**/*.{graphql}', '**/*.{md,mdx}', '**/*.{html}', '**/*.{yaml,yml}'], }, eslint: { patterns: '**/*.{js,jsx,ts,tsx}', customOptions: { fix: true, cache: true }, }, }, }, ], };
Debug
Known issues
gotchaDo NOT target the same file patterns with both prettier and eslint options to avoid redundant work or bad behaviour.
fix
Configure prettier.patterns and eslint.patterns with non-overlapping globs.
affects: >=1.0.0
gotchaThe default initialScan true will format/lint the entire project on Gatsby startup, which may be slow for large projects.
fix
Set initialScan: false in options to skip initial full scan.
affects: >=1.0.0
gotchawatch is true by default, meaning formatting/linting runs on every save. This may cause performance issues or unexpected changes.
fix
Set watch: false in options to disable automatic formatting on save.
affects: >=1.0.0
deprecatedThe package has not been updated since 2021 and may not be compatible with Gatsby v4+ or newer versions of ESLint/Prettier.
fix
Consider alternative plugins like gatsby-plugin-eslint or manually configure lint-staged/husky.
affects: 1.0.6
Errors
Common errors & fixes
Cannot find module 'prettier'
Missing peer dependency 'prettier'
fix
Run: npm install prettier
Cannot find module 'eslint'
Missing peer dependency 'eslint'
fix
Run: npm install eslint
The module 'gatsby-plugin-prettier-eslint' is not a valid Gatsby plugin
Plugin not installed or version incompatible with Gatsby version
fix
Run: npm install gatsby-plugin-prettier-eslint. Ensure Gatsby is version 2.x or 3.x.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
gatsbyrequiredGatsby plugin runtime peer dependency
prettierrequiredRequired for formatting functionality
eslintrequiredRequired for linting functionality
Agent activity
3 hits · last 30 days
node
3
Resources
gatsby-plugin-prettier-eslint — npm install gatsby-plugin-prettier-eslint · libregistry