Comments (5)
Just to see if running stylelint as a postcss plugin would produce similar results, I found that the .stylelintignore
is not honoured at all. Possibly related to this. That issue was closed, by postcss as the recommendation was to use stylelint
as a stand-alone tool, or with gulp-stylelint
–– namecheck!
For anyone that is curious, here is what I tried:
const { src, dest, task, watch, series, parallel } = require("gulp");
const
stylelint = require("stylelint"),
reporter = require("postcss-reporter"),
postcssSass = require("postcss-sass");
var stylePrefs = {
syntax: require("postcss-scss"),
processor: [stylelint({ fix: true, ignoreFiles: ["/styles/scss/vendor/"] }), reporter({ clearReportedMessages: true })],
}
function lint_styles(done) {
src("./styles/**/*")
.pipe(plumber())
.pipe(
postcss(stylePrefs.processor, {
syntax: stylePrefs.syntax,
})
)
.pipe(dest("./styles/"));
done();
}
task("lintStyles", lint_styles);
Just to be through(hopefull) I also tried different combinations of the ignoreFiles: ["./styles/scss/vendor/"]
flag to no avail.
One nice bonus of using gulp-stylelint
is that the console error formatting is much nicer! so I hope we can find a way through this.
from gulp-stylelint.
I solved it for now using a custom formatter. You can also filter out warnings this way:
const stylelint = require('stylelint');
gulp.src( sourcePath('styles.scss') )
.pipe(gulpStylelint({
reporters: [
{
console: true,
// https://github.com/stylelint/stylelint/blob/master/docs/developer-guide/formatters.md
formatter: function (results) {
const filtered = results.filter(r => {
// ignore bootstrap src
if (/bootstrap/.test(r.source)) {
return false;
}
r.warnings = r.warnings.filter(w => w.severity === 'error');
return r.warnings.length > 0;
});
return stylelint.formatters.string(filtered);
}
}
]
})
from gulp-stylelint.
I tried using the custom formatter above. No luck in our environment. Simply doesn't work. Any news on gulp-stylelint
getting future updates? Seems like gulp and it's ecosystem is dying... Do i need to switch to webpack?
from gulp-stylelint.
gulp.task('fix-css', function () {
return gulp
.src([
'src/scss/**/*.scss',
//Exclude the same directory as in the `.stylelintignore` file
'!src/scss/plugins-override/*.scss',
])
.pipe(gulpStylelint({
fix: true,
}))
.pipe(gulp.dest('src/scss'));
});
from gulp-stylelint.
I tried using the custom formatter above. No luck in our environment. Simply doesn't work. Any news on
gulp-stylelint
getting future updates? Seems like gulp and it's ecosystem is dying... Do i need to switch to webpack?
This repository is abandoned. Use my fork, see the comment here.
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
- 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.