Git Product home page Git Product logo

Comments (8)

olegskl avatar olegskl commented on August 31, 2024

Hello. This is weird, I've just run a test and it seems to be working fine.

from gulp-stylelint.

reintroducing avatar reintroducing commented on August 31, 2024

Hmm, I can definitely confirm it's not running. Is there anything I can do to help troubleshoot? Would love to get this working. When I use stylelint directly through the CLI it works as expected on that path with the glob.

from gulp-stylelint.

olegskl avatar olegskl commented on August 31, 2024

Can you provide a small example which reproduces the issue? I have a test repository with several scss files and it's working fine. Actually, I have never tried running gulp without globs...

from gulp-stylelint.

reintroducing avatar reintroducing commented on August 31, 2024

Awesome, I am finishing my work day but will look at this tomorrow afternoon when I'm back in the office (have a doctor's appointment in the AM). I'll try my code in the test repo and see if it works. I suppose its worth nothing I'm using Gulp 3.9.1 rather than 4 but we'll see if that makes any difference.

from gulp-stylelint.

olegskl avatar olegskl commented on August 31, 2024

This should work the same in Gulp 3.x and 4.x (just tested).

Take care :)

from gulp-stylelint.

reintroducing avatar reintroducing commented on August 31, 2024

Good to know. Of note as well is I just ran stylelint CLI on frontend/src/sass/**/*.scss and I'm getting this:

./node_modules/.bin/stylelint "frontend/src/sass/**/*.scss"
TypeError: Cannot read property 'isCalculationEnabled' of undefined
    at findOperators (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint-scss/dist/utils/sassValueParser/index.js:79:36)
    at /Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint-scss/dist/rules/operator-no-unspaced/index.js:192:47
    at /Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:148:26
    at AtRule.each (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:114:22)
    at AtRule.walk (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:147:21)
    at /Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:150:32
    at AtRule.each (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:114:22)
    at AtRule.walk (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:147:21)
    at /Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:150:32
    at AtRule.each (/Users/mprzybylski/Work/SpotHero/SpotHero-Django/node_modules/stylelint/node_modules/postcss/lib/container.js:114:22)

Although this worked fine by just running a directory deeper:

./node_modules/.bin/stylelint "frontend/src/sass/components/*.scss"

I just tried the first one because I have more sass directories inside of sass/ than just components and I'm trying to pinpoint where a problem may be with the CLI.

from gulp-stylelint.

olegskl avatar olegskl commented on August 31, 2024

I haven't used stylelint-scss before, so I'm not sure about the origin of the issue there.

As for the issue with gulp-stylelint, if you can create a small repository (you can just fork gulp-stylelint-test) I will definitely take a look.

from gulp-stylelint.

reintroducing avatar reintroducing commented on August 31, 2024

Alright, I just took some time to play with the test repo. Here are my findings:

  • On initial run as I just followed the instructions, I had 501 errors, not 0 like the repo says. They were formedia-feature-name-no-unknown. Not sure why that happened.
  • The plugin will not exclude globs that look like this (which was working correctly for me when I was using scss-lint): !./frontend/src/sass/vendor/* I'm not a globbing expert so I can't tell you which is correct but all I know is the prior plugin we used did exclude that. I had to convert it to this: !./frontend/src/sass/vendor/**/*.scss
  • And finally, here was my issue. Given the following lint method:
const sassLint = src => {
    return gulp.src(src)
        .pipe(stylelint({
            syntax: 'scss',
            reporters: [{
                formatter: 'string',
                console: true
            }],
            failAfterError: false
        }));
};

This was my actual task(s):

gulp.task('lint:sass:spothero', () => {
    sassLint([
        `${config.spothero.sass}/**/*.scss`,
        `${config.frontend.sass}/**/*.scss`,
        `!${config.spothero.sass}/desktop/jobs/_greenhouse.scss`,
        `!${config.spothero.sass}/utils/sprites/**/*.scss`,
        `!${config.frontend.sass}/vendor/**/*.scss`,
        `!${config.frontend.sass}/common/_icomoon.scss`,
        `!${config.frontend.sass}/utils/**/*.scss`
    ]);
});

Notice that the task itself does not return sassLint, it just runs it. With the prior linter that worked fine. By just adding a return to the front, it now works as expected. Extremely stupid, just like i said when I originally posted the issue :)

Thanks for all your help.

from gulp-stylelint.

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.