Giter Site home page Giter Site logo

Comments (17)

jgable avatar jgable commented on July 30, 2024

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.

Pomax avatar Pomax commented on July 30, 2024

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.

jgable avatar jgable commented on July 30, 2024

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.

Pomax avatar Pomax commented on July 30, 2024

aha. Yeah, let me find the person whose branch raised this issue for us, he'll have a pastable gruntfile =)

from grunt-lesslint.

Hamabama avatar Hamabama commented on July 30, 2024

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.

Hamabama avatar Hamabama commented on July 30, 2024

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.

jgable avatar jgable commented on July 30, 2024

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.

Hamabama avatar Hamabama commented on July 30, 2024

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.

Hamabama avatar Hamabama commented on July 30, 2024

In version 20 we made temporary solution, so it passes Travis. But the real issue is with version 19.

from grunt-lesslint.

Hamabama avatar Hamabama commented on July 30, 2024

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.

jgable avatar jgable commented on July 30, 2024

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.

Hamabama avatar Hamabama commented on July 30, 2024

In other words, we have to force grunt to don't parse certain imports, right?

from grunt-lesslint.

Hamabama avatar Hamabama commented on July 30, 2024

"!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.

jgable avatar jgable commented on July 30, 2024

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.

Hamabama avatar Hamabama commented on July 30, 2024

Thank you for quick response. We'll be waiting to hear from you :)

from grunt-lesslint.

jgable avatar jgable commented on July 30, 2024

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.

jgable avatar jgable commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.