Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific options does not overwrite the global options from .jshintrc #198

Open
exos opened this issue Mar 25, 2015 · 5 comments
Open

Specific options does not overwrite the global options from .jshintrc #198

exos opened this issue Mar 25, 2015 · 5 comments

Comments

@exos
Copy link

exos commented Mar 25, 2015

According the documentation the specific options replaces the global ones, but, It's does not work, I have:

Gruntfile.js (Not complete)

jshint: {
        options: {
            jshintrc: true
        },
        grunt: {
            options: {
                "maxlen": false,
                "strict": false
            },
            files: {
                src: 'Gruntfile.js'
            }
        },
        lib: {
            options: {
            },
            files: {
                src: [
                    'index.js',
                    'lib/*.js',
                    'lib/**/*.js'
                ]
            }
        }

    }
  });

.jshintrc (only the replaced options)

    "strict"        : true, 
    "maxlen"     : 80,

And when I run "grunt" command (with the jshint by default), I get this:

Running "jshint:grunt" (jshint) task

   Gruntfile.js
      5 |  grunt.initConfig({
           ^ Missing "use strict" statement.
     11 |        ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + '\n' +
                                                                                                  ^ Line is too long.
     12 |        ' * License: <%= _.pluck(pkg.licenses, "type").join(", ") %> (<%= _.pluck(pkg.licenses, "url").join(", ") %>)' + '\n' +
                                                                                                                                       ^ Line is too long.

>> 3 errors in 1 file
Warning: Task "jshint:grunt" failed. Use --force to continue.

Aborted due to warnings.

I have installed the version 0.11.1, with node 0.12.0 and npm 2.6.0, running in Archlinux.

├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ [email protected]
│   │ └─┬ [email protected]
│   │   ├── [email protected]
│   │   └─┬ [email protected]
│   │     ├── [email protected]
│   │     └── [email protected]
│   ├─┬ [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ ├── [email protected]
│   │ ├─┬ [email protected]
│   │ │ └─┬ [email protected]
│   │ │   ├── [email protected]
│   │ │   └── [email protected]
│   │ ├── [email protected]
│   │ └─┬ [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   └── [email protected]
│   ├─┬ [email protected]
│   │ ├── [email protected]
│   │ └── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
@MrDefinite
Copy link

Same problem.

@fischermatte
Copy link

+1

@domtronn
Copy link

+1 I saw in the changelog that this was done in v0.3.0 on 2013-03-13 and reverted immediately in v0.4.0 on 2013-04-04.

Is there a reason this was removed? I'd find it very useful.

*_EDIT_* For anyone experiencing this, you can place a second .jshintrc within the directory of secondary grunt target and it will match the first .jshintrc found above the file it's linting.

Hope this helps!

@jshemas
Copy link

jshemas commented Aug 17, 2015

+1

1 similar comment
@benkeen
Copy link

benkeen commented Nov 2, 2018

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants