0

I'm new in Grunt plugin and on the way using CSSLint plugin. I run it ok, but I want to save the errors from console log into file. Can CssLint support that, cos when run csslint on command line (window), if you have many errors or warnning, you can't scroll up to see errors in the beginning. Anybody help me,please ??

kate
  • 179
  • 2
  • 16

1 Answers1

2

If you're fine using the command line, you could pipe it to a file grunt csslint > csslint.log.

Otherwise, you want to use a formatter.

csslint: {
  options: {
    formatters: [
      {id: 'text', dest: 'report/csslint.log'}
    ]
  }
}

Always check out the documentation

bevacqua
  • 47,502
  • 56
  • 171
  • 285
  • yeah, thank your answer. I've tried your way. First, with command line, after pipe result to a file, I get this in the log file (before rows of detail error) [31m[[39m[33mL31[39m[31m:[39m[33mC1[39m[31m][39m => I think that because of line number's color of errors in command line (ex : [L31:C1]). Second, use formatter - I use like the way you suggest, and nothing happen,no new file - I don't think csslint have dest keyword option. T-T – kate Nov 21 '13 at 06:21
  • The color thing you can resolve passing `--no-color` to Grunt. i.e: `grunt foo --no-color`. The formatter stuff, check your `grunt-contrib-csslint` version, update if necessary, and then read the documentation. – bevacqua Nov 21 '13 at 13:13
  • By the way, do you know how to config to stop tasks when they find first error???. My mean, as normal we will see the errors list when task finish, but I want to config when they find a error, they will stop at this error. – kate Nov 22 '13 at 10:26