ahmednuaman / grunt-scss-lint

A Grunt task to lint your SCSS
MIT License
141 stars 35 forks source link

Can't have multiple configs #145

Closed ethikz closed 7 years ago

ethikz commented 7 years ago

My current gruntfile looks like this:

'use strict';

module.exports = function( grunt ) {
  require('time-grunt')( grunt );

  grunt.initConfig({
    vNo: 'v1',
    pkg: grunt.file.readJSON('package.json'),
    filepath: '',
    directory: ''
  });

  grunt.loadTasks('grunt/tasks');
  grunt.loadTasks('grunt/configs');
};

When I run grunt scsslint it runs fine.

module.exports = function( grunt ) {
  grunt.config('scsslint', {
    options: {
      configFile: '.scss-lint.yml',
      reporterOutput: 'scss-lint-report.xml',
      colorizeOutput: true,
      maxBuffer: 30000000000000000000 * 1024
    },
    src: ['src/bbtcom/_assets/scss/**/*']
  });

  grunt.loadNpmTasks('grunt-scss-lint');
};

If I try to run grunt scsslintCalcs I get an error,

Warning: Task "scsslintCalcs" not found. Use --force to continue.
Error: Task "scsslintCalcs" not found.
    at Task.run (/Users/Development/project/node_modules/grunt/lib/util/task.js:179:28)
    at /Users/Development/project/node_modules/grunt/lib/grunt.js:161:39
    at Array.forEach (native)
    at Object.grunt.tasks (/Users/Development/projecy/node_modules/grunt/lib/grunt.js:161:9)
    at Object.module.exports [as cli] (/Users/Development/project/node_modules/grunt/lib/grunt/cli.js:38:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:44:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)

but my scsslintCalcs.js

module.exports = function( grunt ) {
  grunt.config('scsslintCalcs', {
    options: {
      configFile: '.scss-lint.yml',
      reporterOutput: 'scss-lint-report-calcs.xml',
      colorizeOutput: true,
      maxBuffer: 30000000000000000000 * 1024
    },
    src: ['src/leadfusion/*.scss']
  });

  grunt.loadNpmTasks('grunt-scss-lint');
};

So I'm not sure why scsslint works but not the rest.

@ahmednuaman or anyone else any insight as to what is going wrong?

I've tried removing grunt.loadNpmTasks('grunt-scss-lint'); from the tasks even renaming them to just scsslint but keeping the file what I need with no luck

ahmednuaman commented 7 years ago

This seems like a Grunt error, rather than an error of this plugin. Ensure that it's correctly being imported, and other stuff: http://stackoverflow.com/search?q=grunt+task+not+found