On GitHub, prettier/eslint-plugin-prettier has picked up 3.7k stars, JavaScript. ESLint plugin for Prettier formatting
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
eslint-plugin-prettier does not install Prettier or ESLint for you.You must install these yourself.
This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect potential bugs. If another active ESLint rule disagrees with prettier about how code should be formatted, it will be impossible to avoid lint errors. Our recommended configuration automatically enables eslint-config-prettier to disable all formatting-related ESLint rules.
Configuration (legacy: .eslintrc*)
For legacy configuration, this plugin ships with a plugin:prettier/recommended config that sets up both eslint-plugin-prettier and eslint-config-prettier in one go.
Add plugin:prettier/recommended as the last item in the extends array in your .eslintrc* config file, so that eslint-config-prettier has the opportunity to override other configs:
{
"extends": ["plugin:prettier/recommended"]
}
This will:
Enable the prettier/prettier rule.
Disable the arrow-body-style and prefer-arrow-callback rules which are problematic with this plugin - see the below for why.
Enable the eslint-config-prettier config which will turn off ESLint rules that conflict with Prettier.
Configuration (new: eslint.config.js)
For flat configuration, this plugin ships with an eslint-plugin-prettier/recommended config that sets up both eslint-plugin-prettier and eslint-config-prettier in one go.
Import eslint-plugin-prettier/recommended and add it as the last item in the configuration array in your eslint.config.js file so that eslint-config-prettier has the opportunity to override other configs:
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
module.exports = [
// Any other config imports go at the top
eslintPluginPrettierRecommended,
];
This will:
Enable the prettier/prettier rule.
Disable the arrow-body-style and prefer-arrow-callback rules which are problematic with this plugin - see the below for why.
Enable the eslint-config-prettier config which will turn off ESLint rules that conflict with Prettier.
Svelte support
We recommend to use eslint-plugin-svelte instead of eslint-plugin-svelte3 because eslint-plugin-svelte has a correct eslint-svelte-parser instead of hacking.
When use with eslint-plugin-svelte3, eslint-plugin-prettier will just ignore the text passed by eslint-plugin-svelte3, because the text has been modified.
If you still decide to use eslint-plugin-svelte3, you'll need to run prettier --write *.svelte manually.
arrow-body-style and prefer-arrow-callback issue
If you use arrow-body-style or prefer-arrow-callback together with the prettier/prettier rule from this plugin, you can in some cases end up with invalid code due to a bug in ESLint’s autofix – see issue #65.
For this reason, it’s recommended to turn off these rules. The plugin:prettier/recommended config does that for you.
You can still use these rules together with this plugin if you want, because the bug does not occur all the time. But if you do, you need to keep in mind that you might end up with invalid code, where you manually have to insert a missing closing parenthesis to get going again.
If you’re fixing large of amounts of previously unformatted code, consider temporarily disabling the prettier/prettier rule and running eslint --fix and prettier --write separately.
Options
Note: While it is possible to pass options to Prettier via your ESLint configuration file, it is not recommended because editor extensions such as prettier-atom and prettier-vscodewill read .prettierrc, but won't read settings from ESLint, which can lead to an inconsistent experience.
The first option:
An object representing options that will be passed into prettier. Example:
NB: This option will merge and override any config set with .prettierrc files
The second option:
An object with the following options
usePrettierrc: Enables loading of the Prettier configuration file, (default: true). May be useful if you are using multiple tools that conflict with each other, or do not wish to mix your ESLint settings with your Prettier configuration. And also, it is possible to run prettier without loading the prettierrc config file via the CLI's --no-config option or through the API by calling prettier.format() without passing through the options generated by calling resolveConfig.
fileInfoOptions: Options that are passed to prettier.getFileInfo to decide whether a file needs to be formatted. Can be used for example to opt-out from ignoring files located in node_modules directories.
The rule is auto fixable -- if you run eslint with the --fix flag, your code will be formatted according to prettier style.
Line endings
Prettier's default endOfLine is lf. On Windows, files are often checked out or saved with crlf, so eslint reports Delete ␍ (or Insert ␍) for every line even when the file is otherwise formatted. This plugin reports exactly what Prettier would change, so eslint --fix and prettier --write keep producing the same output — it is not specific to this plugin.
Configure line endings where Prettier can see them so the plugin and your editor agree:
.prettierrc: "endOfLine": "auto" keeps each file's existing line endings (use "crlf"/"lf" to enforce one explicitly).
.editorconfig: end_of_line = lf (or crlf).
.gitattributes: for example * text=auto eol=lf, so checkouts are consistent across platforms.
Note that endOfLine: "auto" keeps each file's existing endings but still normalises a file that mixes them, using the first cr/crlf it finds. The plugin then reports the lines that differ, because that is what prettier --write would rewrite. To avoid those diagnostics, make each file's endings consistent with the selected endOfLine value. See #641.
Sponsors
@prettier/plugin-eslint
eslint-config-prettier
eslint-plugin-prettier
prettier-eslint
prettier-eslint-cli
Backers
@prettier/plugin-eslint
eslint-config-prettier
eslint-plugin-prettier
prettier-eslint
prettier-eslint-cli
Contributing
See CONTRIBUTING.md
Changelog
Detailed changes for each release are documented in CHANGELOG.md.
How active is development on prettier/eslint-plugin-prettier?
The most recent commit recorded on prettier/eslint-plugin-prettier was 8 days ago, based on the GitHub push timestamp. The repository has 213 forks — one of the better signals of community interest.
How many stars does prettier/eslint-plugin-prettier have?
prettier/eslint-plugin-prettier has 3.7k GitHub stars — refresh the page for the live number, or check github.com/prettier/eslint-plugin-prettier. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is prettier/eslint-plugin-prettier written in?
prettier/eslint-plugin-prettier is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is prettier/eslint-plugin-prettier associated with?
GitHub's repository topics for prettier/eslint-plugin-prettier: "eslint-plugin", "prettier". TopGit's editorial category is open-source.
Where do I read more about prettier/eslint-plugin-prettier?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/prettier/eslint-plugin-prettier is the definitive source.
Read full README in the tab above.
Curious whether eslint-plugin-prettier is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about eslint-plugin-prettier.