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

plugin config is not namespaced #47

Open
yomed opened this issue Jun 2, 2016 · 2 comments
Open

plugin config is not namespaced #47

yomed opened this issue Jun 2, 2016 · 2 comments

Comments

@yomed
Copy link

yomed commented Jun 2, 2016

Hi, I'm currently using load-grunt-config in order to load grunt task files, each of which contains relevant config for that task. Most plugins will namespace their config. So jsonlint would need config like

jsonlint: {
    src: [ 'some/valid.json' ]
}

And instead, I have jsonlint.js which is loaded and the config is associated with the jsonlint key.

'use strict';

module.exports = function (grunt) {
    grunt.loadNpmTasks('grunt-jsonlint');
    return {
        src: [
            '*.json',
            'src/**/*.json'
        ]
    };
};

However, istanbul does not namespace these, so I can't set up my makeReport task in the same way. Have you considered namespacing some or all of this plugin config? Like:

istanbul: {
    makeReport: {
        src: 'test/coverage/reports/**/*.json',
        options: {
            type: 'lcov',
            dir: 'test/coverage/reports',
            print: 'detail'
        }
    }
}
@yomed
Copy link
Author

yomed commented Jun 2, 2016

It's worth mentioning that I can just name my file makeReport.js to get around this in my case, though I did find it curious that the config wasn't named similarly to other plugins.

@bcwatson22
Copy link

Hi @yomed, did you ever work out a fix for this? My build is failing at Warning: Task "istanbul:instrument" not found. Use --force to continue.

I don't want to add the tasks into my Gruntfile and, even if I create separate JS files for the tasks, e.g. grunt/mochaTest.js, it still can't find some tasks. Seems to work for instrument and makeReport but not mochaTest or storeCoverage ..

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

2 participants