Giter VIP home page Giter VIP logo

Comments (9)

fregante avatar fregante commented on May 22, 2024 1

Closing for 4 years of inactivity and because this exists:

Reopen if unicorn needs to have its own version.

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 22, 2024

Interesting! Can you show an example of how it would look?

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 22, 2024

Relevant:

from eslint-plugin-unicorn.

jamestalmage avatar jamestalmage commented on May 22, 2024

Oh wow. That's a cool way to do it.
Might be slow though. Doesn't it have to load and parse every dependency?

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 22, 2024

@benmosher ⬆️

from eslint-plugin-unicorn.

benmosher avatar benmosher commented on May 22, 2024

It does parse every dependency, but if you're already using the other rules that do static analysis the plugin only parses each dependency at most once, so turning on the no-deprecated rule doesn't add much extra time.

I also wrote an ESLint memoizing parser as an experiment, to cut parse time in half by allowing ESLint proper and the import plugin to share the same parsed AST instead of each parsing their own. It helps, but doesn't even really matter until the project gets big.

My day job application is made of about 1500 module files, IIRC, and takes ~15s to fully lint with the memo-parser.

from eslint-plugin-unicorn.

benmosher avatar benmosher commented on May 22, 2024

BTW, it currently uses JSDoc but could use whatever. It's not obvious to me how prevalent JSDoc is, I mostly use it internally to flag myself and others with yellow rectangles around deprecated identifiers in Sublime.

from eslint-plugin-unicorn.

sindresorhus avatar sindresorhus commented on May 22, 2024

@benmosher I assume the ESLint caching works fine with eslint-plugin-import?

from eslint-plugin-unicorn.

benmosher avatar benmosher commented on May 22, 2024

Yes and no. If you change an imported file, the files that import it won't be invalidated so if any import issues have been introduced, they won't show up. I.E.:

Module A imports B. Lint A with --cache, then delete B, then re-lint A with --cache. I would expect it not to report B as missing since A's content still matches the last lint execution. I am not super-familiar with ESLint's caching though, so I may be wrong.

This is why I use eslint_d for faster console and Sublime linting; the in-process caches of exports default to invalidating after 30s, so an eslint_d re-lint of A would eventually report B as unresolved.

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.