ESLint Plugin Prettier Internal Rules
raw JSON → 2.0.1 verified Sat Apr 25 auth: no javascript
An ESLint plugin containing internal linting rules used by the Prettier project itself. Version 2.0.1 is the current stable release, part of the Prettier monorepo and published to npm primarily for Prettier contributors. The plugin enforces coding conventions within Prettier's codebase, such as no unnecessary backticks or no nested ternaries. It is not intended for general public use but can be referenced for custom rule development.
Common errors
error Error: Failed to load plugin 'prettier-internal-rules': Cannot find module 'eslint-plugin-prettier-internal-rules' ↓
cause Plugin not installed in project.
fix
npm install eslint-plugin-prettier-internal-rules --save-dev
error TypeError: eslint-plugin-prettier-internal-rules is not a function ↓
cause Using require() with ESM-only version v2.0.0+.
fix
Use import instead of require.
error Error: ConfigError: Could not find config for 'prettier-internal-rules' ↓
cause Using eslintrc config instead of flat config with v2.0.0+.
fix
Migrate to flat config (eslint.config.js).
Warnings
gotcha This plugin is specifically for Prettier's internal codebase and may not be stable for external use. ↓
fix Use only if contributing to Prettier or as a reference.
breaking ESM only since v2.0.0; no CommonJS support. ↓
fix Use import syntax or update Node.js to support ESM.
breaking Flat config only since v2.0.0; eslintrc config not supported. ↓
fix Use ESLint flat config (eslint.config.js).
gotcha Rules may change without major version bump as they are internal. ↓
fix Pin exact version if using externally.
Install
npm install eslint-plugin-prettier-internal-rules yarn add eslint-plugin-prettier-internal-rules pnpm add eslint-plugin-prettier-internal-rules Imports
- plugin wrong
const plugin = require('eslint-plugin-prettier-internal-rules')correctimport plugin from 'eslint-plugin-prettier-internal-rules' - rules wrong
const { rules } = require('eslint-plugin-prettier-internal-rules')correctimport { rules } from 'eslint-plugin-prettier-internal-rules' - configs
import { configs } from 'eslint-plugin-prettier-internal-rules'
Quickstart
import plugin from 'eslint-plugin-prettier-internal-rules';
export default [
{
plugins: { 'prettier-internal-rules': plugin },
rules: {
'prettier-internal-rules/no-unnecessary-backticks': 'error',
},
},
];