Socket
Socket
Sign inDemoInstall

eslint-config-prettier

Package Overview
Dependencies
88
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.


Version published
Maintainers
1
Install size
17.6 kB
Created

Package description

What is eslint-config-prettier?

The eslint-config-prettier npm package is used to disable all formatting-related ESLint rules that might conflict with Prettier. This allows developers to use both ESLint and Prettier without having to deal with conflicting formatting rules. It ensures that ESLint focuses on code-quality rules, and Prettier takes care of code formatting.

What are eslint-config-prettier's main functionalities?

Disabling conflicting rules

By extending eslint-config-prettier in your ESLint configuration file, you can turn off all rules that are unnecessary or might conflict with Prettier.

{ "extends": ["prettier"] }

Integration with other ESLint configs

eslint-config-prettier can be easily integrated with other ESLint configurations like Airbnb by placing it last in the extends array, which ensures that it will override any other formatting rules that might conflict with Prettier.

{ "extends": ["airbnb", "prettier"] }

Support for plugins

eslint-config-prettier provides support for disabling conflicting rules from various ESLint plugins, such as React or TypeScript, ensuring compatibility across different codebases.

{ "extends": ["prettier/react", "prettier/@typescript-eslint"] }

Other packages similar to eslint-config-prettier

Changelog

Source

Version 7.0.0 (2020-12-05)

  • Changed: At least ESLint 7.0.0 is now required.

  • Changed: [arrow-body-style] and [prefer-arrow-callback] are no longer turned off by default. They only need to be turned off if you use [eslint-plugin-prettier]. If you do, add "prettier/prettier" to your "extends" array to turn them off again.

    {
      "extends": ["prettier", "prettier/prettier"],
      "plugins": ["prettier"],
      "rules": {
        "prettier/prettier": "error"
      }
    }
    

    Alternatively, update [eslint-plugin-prettier] to version 3.2.0 or later which automatically turns off these two rules in its "plugin:prettier/recommended" config.

    The CLI helper tool only warns about these rules if you have the "prettier/prettier" rule enabled for a file.

  • Changed: no-tabs is now a validatable rule. If you use it, you should enable allowIndentationTabs so that the rule works regardless of your Prettier config:

    {
      "rules": {
        "no-tabs": ["error", { "allowIndentationTabs": true }]
      }
    }
    
  • Changed: The CLI helper tool is now called just eslint-config-prettier instead of eslint-config-prettier-check. This is so that npx eslint-config-prettier always works regardless of whether you have already installed eslint-config-prettier or not: If you have, the local installation is used; if you haven’t, npx downloads a temporary copy.

  • Changed: The CLI helper tool no longer requires you to pipe the output of eslint --print-config to it. Instead, it does that automatically for you via ESLint API:s added in ESLint v7.

    Before:

    npx eslint --print-config index.js | npx eslint-config-prettier-check
    

    After:

    npx eslint-config-prettier index.js
    
  • Improved: The npm package is now 75% smaller.

Readme

Source

eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with [Prettier].

This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier.

Note that this config only turns rules off, so it only makes sense using it together with some other config.

➡️ Full readme

Keywords

FAQs

Last updated on 05 Dec 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc