node.jsbuild-processlintcsslint

How could you LINT your LESS and SCSS files in Node JS WITHOUT using grunt or gulp?


So the thing is I went through the internet and checked for available linters. Mostly all the the LESS linters available provide a command line interface or a plugin for grunt or gulp. What I really want is a simple Node Plugin which is configurable and usable with NODEJS through Code and not through CLI.

Also due to unavailability of the tags such as LESSLINT and SCSSLINT could not add those tags to the questions.

  1. Is there any node plugin available to do this?
  2. If not, How can I use CLI through NodeJS and also get the callbacks?

I need the callbacks since that's the most powerful feature of NodeJS and besides my code is dependent on the callbacks..

P.S.: I do not need any code, all I need is directions.

Thanks for the support


Solution

  • A Node port of scss-lint was recently released, you can get it here: https://github.com/FWeinb/scsslint

    It can be used either in Grunt or just as a normal Node module.

    LESS has built-in linting, but it doesn't seem to be accessible through Node. You can use spawn or exec and the LESS CLI with the --lint flag. See the LESS docs here: http://lesscss.org/usage/#command-line-usage-options