Coder Social home page Coder Social logo

Comments (15)

stephenmathieson avatar stephenmathieson commented on July 17, 2024

Your exclude glob is excluding directories, not files.

Try exclude: ['src/thirdparty/**/*', 'src/widgets/**/*'],.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

It's nothing with the exclude even if I delete it throws the same error, seems like ** is not supported. When I do this:

src: ['*.js', 'src/*.js', 'src/*/*.js', 'src/*/*/*.js', 'src/*/*/*/*.js'],

I get it fine

317 files scanned.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

You can try it here:

git clone -b zaggino/grunt-jslint https://github.com/adobe/brackets.git

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

hmm... it seems to work for me:

$ grunt jslint --no-color > log
$ tail log
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:48:2  Expected 'trimRight' at column 17, not column 2.
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:50:1  Use spaces, not tabs.
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:51:1  Use spaces, not tabs.
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:51:2  Expected 'rsingleTag' at column 17, not column 2.
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:53:1  Use spaces, not tabs.
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/tests/jquery-1.7.2.js:53:1  Too many errors. (0% scanned).

# JSLint failed, 26005 violations in 953.  989 files scanned.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

Ah yes, it works immediately after the clone - sorry.
When you do git submodule update --init it stops working :)

JSHint works fine so I guess it will be some exception when traversing the directories.

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

Yeah, you're using exclude wrong. Don't exclude directories, but files instead.

Apply this patch to your repository:

diff --git a/Gruntfile.js b/Gruntfile.js
index c762065..56416a3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -294,7 +294,7 @@ module.exports = function (grunt) {
         jslint: {
             client: {
                 src: ['*.js', 'src/**/*.js'],
-                exclude: ['src/thirdparty/*', 'src/widgets/*'],
+                exclude: ['src/thirdparty/**/*.js', 'src/widgets/**/*.js'],
                 directives: {
                     "vars":     true,
                     "plusplus": true,

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

btw, after the patch:

$ grunt jslint --no-color > log
$ tail log
src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_ecma5.js:33:1    'a3' was used before it was defined.
src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_ecma5.js:35:1    Expected 'var' at column 5, not column 1.
src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_ecma5.js:35:1    Too many errors. (8% scanned).
FAIL    src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_simple.js (2)
src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_simple.js:2:1    Expected an identifier and instead saw 'x'.
src/extensions/default/JavaScriptCodeHints/thirdparty/tern/test/cases/hint_simple.js:2:1    Stopping. (18% scanned).

# JSLint failed, 26905 violations in 1053.  1094 files scanned.

Done, without errors.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

Ah thanks.

Another thing - can I give you a PR to specify a custom JSLint.js file in the grunt options?

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

I believe that's already in the works, but a PR would be appreciated.

/cc @smikes

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

I was asking because I really could use it and #34 hasn't been updated for 3 months

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on July 17, 2024

Go for it ;)

FYI, https://github.com/stephenmathieson/grunt-jslint/blob/master/lib/jslint.js#L52 may solve your problem

from grunt-jslint.

smikes avatar smikes commented on July 17, 2024

Which edition do you need? If it's not one that's present in node-jslint, I can add it for you.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

We already include JSLint file with Brackets and it makes more sense to us just to specify a path to this file inside our project.

from grunt-jslint.

smikes avatar smikes commented on July 17, 2024

OK. If you're going to put in a PR please have it use an absolute path, since the loading is delegated to a dependency of grunt-jslint; if it were a relative path, it would need to be relative to the node_modules/jslint/lib subdirectory, which is more complexity than I want to expose.

from grunt-jslint.

zaggino avatar zaggino commented on July 17, 2024

PR is up, I'm not 100% sure what you meant by absolute path, please review.

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.