Comments (17)
We shouldn't be reporting errors from imported files unless you pass an imports
option that specifies them.
Can you paste your grunt config so we can check if that is what you are doing?
from grunt-lesslint.
that's what I mean. My less has "import ...." and some of those imports are from bower_components locations (so that we can use not-our-module variables, etc). However, whether they lint their css/less or not can completely ruin less linting of our own code, since there does not appear to be a way to say "lint only the sections that belong to files that we made. follow dependencies, but don't lint ones that come from [bower_components, node_modules, etc]". Even if our less is technically good, linting errors in not-our-style can make the entire linting process fail, which ends up causing continuous integration testing failures (travisCI etc) and thus means we can't be sure whether we can merge code in for deployment or not =(
from grunt-lesslint.
Yes, I understand. We don't report those errors unless your grunt configuration passes an imports
option.
.... Can you paste your grunt config so we can check if that is what you are doing?
from grunt-lesslint.
aha. Yeah, let me find the person whose branch raised this issue for us, he'll have a pastable gruntfile =)
from grunt-lesslint.
https://github.com/Hamabama/popcorn.webmaker.org/blob/lesslint/Gruntfile.js
Here please see we have attempted to exclude bower dir from linting, however it follows import paths, so it ends up linting files from bower dir.
from grunt-lesslint.
Additional information: Here you can see we import languages.less on line 4, so it follows it and lints it and lints all import paths from imported languages.less as well.
https://github.com/Hamabama/popcorn.webmaker.org/blob/lesslint/public/css/header.less
from grunt-lesslint.
I cloned down your project and am not getting any errors reported when running grunt lesslint. Here is my output
> grunt lesslint --verbose
Running "lesslint" task
Running "lesslint:src" (lesslint) task
Verifying property lesslint.src exists in config...OK
Files: public/css/butter.ui.less, public/css/embed.less -> src
Options: less=undefined, csslint={"adjoining-classes":false,"box-model":false,"box-sizing":false,"bulletproof-font-face":false,"compatible-vendor-prefixes":false,"duplicate-background-images":false,"fallback-colors":false,"ids":false,"important":false,"outline-none":false,"overqualified-elements":false,"qualified-headings":false,"regex-selectors":false,"star-property-hack":false,"underscore-property-hack":false,"universal-selector":false,"unique-headings":false,"unqualified-attributes":false,"vendor-prefix":false,"zero-units":false}, imports=undefined, cache=false
Linting 'public/css/butter.ui.less'Reading public/css/butter.ui.less...OK
Linting 'public/css/embed.less'Reading public/css/embed.less...OK
>> 2 files lint free.
Can you give me an example where it's giving you an error it shouldn't?
from grunt-lesslint.
Oh sorry. You need to change on line 12 version of webmaker-language-picker in bower.json to 19.
https://github.com/Hamabama/popcorn.webmaker.org/blob/lesslint/bower.json
from grunt-lesslint.
In version 20 we made temporary solution, so it passes Travis. But the real issue is with version 19.
from grunt-lesslint.
In header.less it will import webmaker-language-picker/stylesheets/languages.less and next will be imported files form languages.less and Travis will complain that it can't find 'colors.less'.
from grunt-lesslint.
Right, that's not reporting a linting error, that's reporting a parsing error. It can't parse the less file, so it can't lint it.
I just tried running lessc directly on the file and it works (via lessc --strict-imports public/css/butter.ui.less
) for some reason.
from grunt-lesslint.
In other words, we have to force grunt to don't parse certain imports, right?
from grunt-lesslint.
"!public/static/bower/*/" is directive for grunt to exclude path from array of paths, so theoretically it shouldn't parse it. However it follows import paths and parses it. Oo
from grunt-lesslint.
It doesn't work like that. The actual LESS Parser is the thing that is throwing that error. I'm not even sure why the command line allows it, I'm still doing some research on what options might be different.
from grunt-lesslint.
Thank you for quick response. We'll be waiting to hear from you :)
from grunt-lesslint.
Ok, the only reason it works when you run the command line directly (lessc --strict-imports public/css/butter.ui.less
) is that they add the public/css
directory to the paths to look for imports in and it finds public/css/colors.less
to resolve that import and it doesn't fail.
I don't think that's actually what you wanted to do with that import statement, but I'm going to see about adding the current files path to the parse call to match the command line default behavior.
from grunt-lesslint.
I'm still having some problems after publishing a new version. Looks like the source maps aren't able to resolve some of the errors in your files.
It also looks like CSS Lint is reporting some "rollup" errors which aren't associated with files and cause problems when I try to get a source map location for them. I'll create another issue for that.
from grunt-lesslint.
Related Issues (20)
- NPM package should be named 'grunt-contrib-lesslint' HOT 4
- DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. HOT 1
- Imported files aren't linted HOT 21
- Please read the question from closed issue #53
- Possiblity to mute certain errors? HOT 3
- Getting errors from imports without specifying the imports HOT 7
- Way to rewrite import rules HOT 3
- Comments in .csslintrc HOT 3
- Load options through the .csslintrc file in the current working directory HOT 2
- Import Statement leads to Parse Error HOT 3
- Change to using grunt in js instead of coffee HOT 4
- Update less to 2.5.x? HOT 1
- I can't get lesslint to honor newer HOT 1
- Not Validating HOT 13
- Add support for showing lint warnings HOT 2
- Would like to add imports before parsing HOT 1
- [Question] Dislay multiple errors per file HOT 1
- Update dependencies HOT 1
- Is it possible to ignore lines? HOT 1
- parsing error: Cannot read property 'lineNumber' of undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-lesslint.