question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deprecate rule `prettier` since `eslint-plugin-prettier` itself supports virtual filenames correctly now

See original GitHub issue

See

https://github.com/prettier/eslint-plugin-prettier/pull/401/files#diff-e9a90fe7b2d3420b8e5f64e24d5f56ffe6383e47b07461172cc29ed21b768905R197-R199

and

https://github.com/prettier/eslint-plugin-prettier/blob/master/eslint-plugin-prettier.js#L192-L209


Besides, actually it is supported previously too. All the user need to do is like the following:

module.exports = {
  // ...
  overrides: [
    {
      files: '*.graphql', // it includes virtual filenames like `*.js/0_document.graphql` already
      rules: {
        'prettier/prettier': [
          2,
          {
            parser: 'graphql',
          },
        ],
      },
    },
  ],
}
<del> After `eslint-plugin-prettier@3.4.0`, the above configuration is not needed any more too! </del>

Maybe in eslint-plugin-pretter@3.5.0 after https://github.com/prettier/eslint-plugin-prettier/pull/413 and https://github.com/prettier/eslint-plugin-prettier/pull/415 been merged and released.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JounQincommented, Apr 22, 2021

I’ve raised https://github.com/prettier/eslint-plugin-prettier/pull/413 to make sure eslint-plugin-prettier will be compatible with this plugin out of the box.

I’ll raise another PR to remove the prettier rule in this repo in the next step.

0reactions
dotansimhacommented, May 18, 2021

Available in v1.0.0! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint plugin for Prettier formatting - GitHub
This plugin works best if you disable all other ESLint rules relating to code formatting, and only enable rules that detect potential bugs....
Read more >
eslint-plugin-prettier | Yarn - Package Manager
Build Status. Runs Prettier as an ESLint rule and reports differences as individual ESLint issues. If your desired formatting does not match Prettier's...
Read more >
Proper way of Installing ESlint with Prettier in a React Project
To run prettier as an eslint rule, you would want to add a rule that allows eslint to run prettier. You do that...
Read more >
Integrating with Linters - Prettier
Most stylistic rules are unnecessary when using Prettier, but worse – they might conflict with Prettier! Use Prettier for code formatting concerns, and...
Read more >
How to make ESLint work with Prettier avoiding conflicts and ...
JavaScript; Yes (install all dependencies). After this process, you'll find a new file in your root folder: .eslintrc.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found