Coder Social home page Coder Social logo

Comments (6)

jamestalmage avatar jamestalmage commented on May 9, 2024

It all comes back to type analysis. The easier it is to infer that a given variable is of a given type, the easier it is to write this type of rule.

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 9, 2024

@jamestalmage Sure, but in this case, the template literal or string is always put inline in the function call. If not, we could always use path analysis it's a 99% certainty it's in the same file. But yeah, many other cases might be harder. I don't think that should limit our brainstorming here though.

from eslint-plugin-unicorn.

jamestalmage avatar jamestalmage commented on May 9, 2024

Oh - I meant ensuring meow was meow. But yes, it also applies to the template variable as well. Not against it - just saying adding a lot of type dependent rules without a good typing system is burdensome (echoing what we have already said)

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 9, 2024

@jamestalmage Yeah, totally, but don't limit your brainstorming to type dependent rules. Lots of other things that could be useful. I should have found a better example in the issue description than a type dependent one.

from eslint-plugin-unicorn.

jamestalmage avatar jamestalmage commented on May 9, 2024

My point was that type analysis is required for any "uses XXX appropriately" rule. You have to narrow down that a given variable is of type XXX. It's easy for meow since you basically always use the import directly.

from eslint-plugin-unicorn.

fregante avatar fregante commented on May 9, 2024

Closing discussion as inactive for 4 years. Now there's a node-specific plugin: https://github.com/mysticatea/eslint-plugin-node

from eslint-plugin-unicorn.

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.