Coder Social home page Coder Social logo

Comments (15)

satazor avatar satazor commented on June 15, 2024 3

Probably also related: we should lax newline-per-chained-call, which is has a max depth of just 2.

from eslint-config.

ruipneves avatar ruipneves commented on June 15, 2024 3

Please do, the newline-per-chained-call is a pain in the *** as it is at the moment and it becomes strange when you have just 3 calls for example because one will be going to the next line. Either we define it as 1 and it all goes in a new line or we make it bigger

from eslint-config.

ruipneves avatar ruipneves commented on June 15, 2024 2

Yes, at the moment that is valid as well. The real problem is when you want everything in a one liner having 3 calls

from eslint-config.

zebateira avatar zebateira commented on June 15, 2024 1

@ruipneves yeah, what I mean is you can still put them in each line right?

array
    .filter()
    .map()
    .filter()

this would be valid right? (a part from indentation)

from eslint-config.

satazor avatar satazor commented on June 15, 2024 1

@hugomrdias Prettier does have have an overlap with eslint in regards to formatting, especially now that eslint has autofix. Still, eslint does much more than just formatting, which is linting. As an example, it detects errors based on static analysis that prettier doesn't do.

@ritazoliveira do you want to take on this? So overall, we need to:

  • Remove all exceptions made to indent (SwitchCase and MemberExpression) and update tests
  • Lax newline-per-chained-call into a larger depth or completely disable it

This is a breaking change, so the commits should reflect that. It might be worth making these as separate PRs.

from eslint-config.

zebateira avatar zebateira commented on June 15, 2024

Agreed 👌

Would also do it for SwitchCase, but maybe that's less standard.

from eslint-config.

paulobmarcos avatar paulobmarcos commented on June 15, 2024

Yep, not only it becomes more readable but also seems more inline with what we are used to do and what our current rules are enforcing.

from eslint-config.

acostalima avatar acostalima commented on June 15, 2024

Please do, the newline-per-chained-call is a pain in the *** as it is at the moment and it becomes strange when you have just 3 calls for example because one will be going to the next line. Either we define it as 1 and it all goes in a new line or we make it bigger

Yeah, I must admit the above is quite annoying in my opinion...

from eslint-config.

zebateira avatar zebateira commented on June 15, 2024

Please do, the newline-per-chained-call is a pain in the *** as it is at the moment and it becomes strange when you have just 3 calls for example because one will be going to the next line. Either we define it as 1 and it all goes in a new line or we make it bigger

@ruipneves but you can put all of them inline still right? (https://eslint.org/docs/rules/newline-per-chained-call)
Or you mean it sucks because the autofix puts it 2 (first lines) + 1 (next line)?
Do agree that max depth of 2 is weird - only one or everything in each new line sounds better @ruipneves 👌

from eslint-config.

ruipneves avatar ruipneves commented on June 15, 2024

It sucks because of the new line 😛

array.filter().map()

.filter()

from eslint-config.

hugomrdias avatar hugomrdias commented on June 15, 2024

Wouldn't prettier solve all the formatting issues and simplify the config. Feel free to ignore me as I'm not very familiar with the repo.

from eslint-config.

hugomrdias avatar hugomrdias commented on June 15, 2024

@satazor yes I know all that, just saying leave the formatting to prettier and linting to eslint. This setup is pretty standard even with styles (prettier/style lint).

from eslint-config.

acostalima avatar acostalima commented on June 15, 2024

I'm not familiar with prettier, but if eslint does as much as prettier and even more, what would be the point to maintain a prettier config as well?

from eslint-config.

ritazoliveira avatar ritazoliveira commented on June 15, 2024

Both PR's are now open for review.

from eslint-config.

satazor avatar satazor commented on June 15, 2024

Addressed by #83 and #82

from eslint-config.

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.