GithubHelp home page GithubHelp logo

Comments (2)

idok avatar idok commented on June 12, 2024

what is the use case for allowing both?

from eslint-plugin-lodash.

cbovis avatar cbovis commented on June 12, 2024

Would also be interested in being able to do this.

The use case is that we've enforced method imports for a long time due to tree shaking. In VS Code however automatic imports via autocomplete prefers the member style of import (e.g. if you type map and then use autocomplete to insert the import statement for you). This means that after autocompleting an import you then have to modify that import manually to conform with the ESLint rule.

Because we use NextJS we can modularize our imports so that member imports will be swapped out by the compiler for method imports automatically. This improves DX because we get tree shaking benefits even for member import, can therefore allow the member import style, and won't need to mess about with modifying imports after autocomplete.

Problem is that we have 100s of existing method imports. There's nothing technically wrong with allowing both member and method imports BUT I would like to disallow the full import style since allowing this could bloat our package size.

For now it seems like the only way to allow multiple import styles is to go nuclear and completely disable the rule but that opens us up to the possibility of full imports.

from eslint-plugin-lodash.

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.