Git Product home page Git Product logo

Comments (14)

lydell avatar lydell commented on September 18, 2024 14

There are two ways of using Prettier and ESLint at the same time:

  1. Let Prettier handle the formatting of your code, and turn off all stylistic rules in ESLint (because they mostly conflict with Prettier, like in your case). eslint-config-prettier helps doing this.

  2. Use prettier-eslint. This runs Prettier first, and then eslint --fix. This is if you disagree with some code formatting choice that Prettier has made, and want ESLint to automatically adjust that.

It looks like you are currently using method 1, but actually want method 2. So try out prettier-eslint!

from eslint-config-prettier.

cybermerlin avatar cybermerlin commented on September 18, 2024 9

still doesn't work
image

.prettierrc
"breakBeforeElse": true

.eslintrc.js

    'brace-style': [
      'error',
      'stroustrup',
      {
        'allowSingleLine': true
      }
    ],

from eslint-config-prettier.

ony3000 avatar ony3000 commented on September 18, 2024 6

Hello everyone!

Today I released a prettier plugin, maybe this will help.

from eslint-config-prettier.

romerobrjp avatar romerobrjp commented on September 18, 2024 2

The same problem still occurs here, even with the suggested configurations...

Any further ideas of how to solve this issue?

image
image
image

from eslint-config-prettier.

ony3000 avatar ony3000 commented on September 18, 2024 2

@mmorgan4x When I first created the plugin, it reflected my tastes a bit; I dislike single-line blocks, so I didn't implement the allowSingleLine option. 😂

Now that I think about it again, it is very difficult to implement considering the internal logic of the current plugin.

@JounQin We talked about the prettier plugin I created. Please refer to this comment. 😆

from eslint-config-prettier.

psyanite avatar psyanite commented on September 18, 2024 1

@lydell Thanks for taking the time and effort to respond to my question. I really appreciate it. Things are much more clear from your explanation now thank you so much.

🍰

from eslint-config-prettier.

dockleryxk avatar dockleryxk commented on September 18, 2024 1

@ony3000 I was about to write my own plugin, how convenient

from eslint-config-prettier.

xNevrroXx avatar xNevrroXx commented on September 18, 2024 1

Hello everyone!

Today I released a prettier plugin, maybe this will help.

Thanks a lot)

from eslint-config-prettier.

max-programming avatar max-programming commented on September 18, 2024 1

I hated the 1tbs style
@ony3000 You're a life saver buddy! Thanks!

from eslint-config-prettier.

ItsCubeTime avatar ItsCubeTime commented on September 18, 2024

Could we see this being added? What solution do other people use for this? Would like to have simple allman case formatting in CSS & Javascript

from eslint-config-prettier.

JounQin avatar JounQin commented on September 18, 2024

This is no such option for prettier at all.

prettier/prettier#840

from eslint-config-prettier.

ocsoares avatar ocsoares commented on September 18, 2024

any solution?

from eslint-config-prettier.

mmorgan4x avatar mmorgan4x commented on September 18, 2024

@ony3000 does the plugin support the option for allowSingleLine": true as well? If not can it?

from eslint-config-prettier.

JounQin avatar JounQin commented on September 18, 2024

No idea What's your meaning, it's a 7 years old issue. 😆

from eslint-config-prettier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.