Code Monkey home page Code Monkey logo

Comments (11)

stevenvachon avatar stevenvachon commented on May 13, 2024 2

I disagree. I'd prefer to not have needless regex in my code.

from you-dont-need-lodash-underscore.

terrierscript avatar terrierscript commented on May 13, 2024 2

This repo is not forcing anyone to follow all the native alternatives presented.

I agree to this ( and PR welcome 😃 )

from you-dont-need-lodash-underscore.

gnapse avatar gnapse commented on May 13, 2024 1

For me the real benefit of this project, including its eslint configuration, is to remove unnecessary code from my bundles when I can go by with a lighter alternative. If you take a look at trimEnd's implementation you'll see that it's not at all a one liner or anything like that. It even depends on a few other lodash internal stuff (the same goes for trimStart).

However, for the most common use case where the second parameter is not provided, because you want to trim whitespace, the alternative solution involves a lot less code, a simple one-liner using a native javascript method, and a relatively simple regex. I think it's worth to show users the simpler alternative in this case. I'd even go as far as to say that it should be recommended, if we ever have a recommended preset. For users that do not want to write the regex, as is your case, the rule can always be turned off in the eslintrc file.

from you-dont-need-lodash-underscore.

heygrady avatar heygrady commented on May 13, 2024 1

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

from you-dont-need-lodash-underscore.

stevemao avatar stevemao commented on May 13, 2024

Thanks @gnapse
PR welcome

from you-dont-need-lodash-underscore.

gnapse avatar gnapse commented on May 13, 2024

Isn't this repo about recommendations to users of lodash of when they could go by with a relatively simple native alternative? I understand that some users may still prefer lodash's way of doing some particular task, and that's fine. This repo is not forcing anyone to follow all the native alternatives presented.

from you-dont-need-lodash-underscore.

stevenvachon avatar stevenvachon commented on May 13, 2024

I guess, but it's going to cause a detailed initial configuration or annoying future changes when the "all" preset is too restrictive. Perhaps we need a "recommended" preset.

from you-dont-need-lodash-underscore.

stevemao avatar stevemao commented on May 13, 2024

I guess, but it's going to cause a detailed initial configuration or annoying future changes when the "all" preset is too restrictive. Perhaps we need a "recommended" preset.

I think you are talking about the eslint config?

from you-dont-need-lodash-underscore.

stevenvachon avatar stevenvachon commented on May 13, 2024

I think you are talking about the eslint config?

Isn't that the function of this project? But, yes, and this specifically: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore/blob/master/configuring.md#now-configure-your-plugin

from you-dont-need-lodash-underscore.

stevemao avatar stevemao commented on May 13, 2024

Isn't that the function of this project?

The eslint doesn't really include things like these. Only the simple ones like concat() or map() (the ones you can easily replace lodash with the corresponding native methods without thinking too much). However, the readme can go a bit future as per @gnapse mentioned above.

from you-dont-need-lodash-underscore.

stevenvachon avatar stevenvachon commented on May 13, 2024

I see the readme as a good support for the eslint config. The primary goal is to be told "you don't need this".

from you-dont-need-lodash-underscore.

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.