jgable / grunt-lesslint

Lint LESS files with Grunt
http://jgable.github.io/grunt-lesslint
MIT License
75 stars 27 forks source link

Way to rewrite import rules #64

Open EvHaus opened 9 years ago

EvHaus commented 9 years ago

We use webpack for bundling less files and webpack supports the "~" prefix for imports as a shortcut for the "node_modules" directory. Unfortunately, lesslint doesn't understand this syntax which results in the following error:

Error parsing html/less/themes/test.less: '~lesshat/build/lesshat.less' wasn't found

Is there some way to configure lesslint so that I can say something like: {paths: {"~lesshat/build/": "./node_modules/lesshat/build/"}}

jgable commented 9 years ago

Unfortunately, this is a parse error from the less parser itself. It's possible that we may be using an outdated less parser. What does webpack use to parse their less files and add that custom path resolution?

EvHaus commented 9 years ago

According to https://github.com/webpack/less-loader#imports webpack does this at run time.

jgable commented 9 years ago

Well, that's certainly advanced. I'll have to take a look at what we can do here to support that, but it gives me hope that they documented it well.