Coder Social home page Coder Social logo

Comments (5)

smikes avatar smikes commented on July 17, 2024

This is issue 42, branch is smikes/grunt-jslint exclude-On-42 (will come in as a separate pull request because I did this badly...)

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

Should this be closed?

from grunt-jslint.

smikes avatar smikes commented on July 17, 2024

Let's wait to see if @sterpe weighs in in the next couple days.

On Mar 20, 2014, at 10:28 AM, Stephen Mathieson [email protected]
wrote:

Should this be closed?

Reply to this email directly or view it on
GitHubhttps://github.com//issues/42#issuecomment-38188867
.

from grunt-jslint.

sterpe avatar sterpe commented on July 17, 2024

@smikes
Either way they're both O(n) algorithms so should be better in general. I think the algorithm cribbed from JSHint code base is probably faster in situations where someone has a lot of files and is using very few very broad globs, i.e,

['src/**/*.js', '!**/node_modules/**']

since it doesn't actually try to expand all the files in the (potentially huge) exclusion glob.

If the globs are extremely specific, I imagine the map is faster.

The one problem with the map approach is because it doesn't regex the exclusion glob against an fp it's subject to issues of equivalent paths having inequivalent strings -- i.e.,

['./foo/**/*.js', '!**/node_modules/**'] 

in this case, I think that

**/node_modules/** 

is going to expand to:

foo/node_modules/... 

so all of the exclusions may be ignored (but we should check this I think).
easy fix is

[..., '!./foo/**/node_modules/**'] 

but an issue to be aware of.

from grunt-jslint.

sterpe avatar sterpe commented on July 17, 2024

FWIW, I guess the issue with #41 is that we didn't path.resolve the exclude paths so the minimatch failed.

I'm fine with whatever approach. Thanks @smikes @stephenmathieson

from grunt-jslint.

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.