Comments (8)
Hello. This is weird, I've just run a test and it seems to be working fine.
from gulp-stylelint.
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.
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.
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.
This should work the same in Gulp 3.x and 4.x (just tested).
Take care :)
from gulp-stylelint.
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.
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.
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 for
media-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)
- Takes a long time to load HOT 1
- How to use gulp-stylelint with caching?
- Fix flag overwrites scss file content HOT 3
- Seperate report per input file
- Why is `stylelint` not a dependency? HOT 1
- autofix isn't working HOT 1
- Option { fix: true; } fails if src glob has an exclusion HOT 2
- Improve streams for Gulp 4 HOT 4
- warning " > [email protected]" has incorrect peer dependency "stylelint@^9.6.0". HOT 1
- `fix: true` + .stylelintignore results in ignored files content replaced with `[]` HOT 5
- Print absolute paths with the string formatter
- Update to stylelint 12.0 HOT 2
- Remove mkdirp?
- gulp-stylelint failing out of gulp process on error HOT 5
- Upgrade to newer version of stylelint HOT 15
- Update to stylelint 14 HOT 1
- Error "ruleMetadata" when using "verbose" or "github" formatter (reporters) HOT 1
- Stylehint .pipe to gulp.dest causing unHandeled 'error' event HOT 1
- `node_modules` not ignored HOT 2
- Can't get autofix to work HOT 2
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 gulp-stylelint.