Comments (16)
https://github.com/stylelint/stylelint/blob/master/docs/developer-guide/plugins.md#peer-dependencies
from gulp-stylelint.
Well, then gulp-eslint
is doing it wrong too :-)
This is exactly what peer-dependencies are for, and it works perfectly for e.g. gulp-tslint
, which also has a massive number of users. I really don't see what the problem is - having it as a peer dependency allows us to update stylelint
independent of gulp-stylelint
, and if an incompatible version is installed, we get a warning. Perfect.
For reference:
https://nodejs.org/en/blog/npm/peer-dependencies
Also note:
As of [email protected], the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. To get the old behavior, use npm --depth Infinity update, but be warned that simultaneous asynchronous update of all packages, including npm itself and packages that npm depends on, often causes problems up to and including the uninstallation of npm itself.
https://docs.npmjs.com/cli/update
from gulp-stylelint.
I'm not really in favor of peer dependencies. Sure they are useful to some people, but they create a whole lot of trouble for the majority of users.
from gulp-stylelint.
Yes sorry I didn't mean to suggest to use peer dependencies, what I am suggesting is to attempt to resolve the stylelint
package from the projects node_modules
before loading gulp-stylelints
own stylelint
dependency. That way if a project wanted to manage the stylelint
version they could do so.
I was thinking something similar to how eslint_d
handles it: https://github.com/mantoni/eslint_d.js/blob/master/lib/linter.js
from gulp-stylelint.
@olegskl
How do you suggest going about updating stylelint
without reinstalling gulp-stylelint
every time stylelint
releases a minor version?
from gulp-stylelint.
@woble You don't need to reinstall gulp-stylelint every time stylelint releases a minor version.
from gulp-stylelint.
@chrishoage Sorry for late response. I just... really, really don't want to add complexity to the library that uses the latest versions of its dependencies. People will install an unsupported version of stylelint and start asking questions "why isn't gulp-stylelint working?".
If you want to use a certain version of stylelint, you can:
- Use it directly in gulp without gulp-stylelint (you will lose some nice functionality though).
- Install a previous version of gulp-stylelint (I recall that 1.1.0 and 2.0.2 did work well with previous versions of stylelint).
- Fork?
Or maybe you can persuade the guys working on "some other tools" you mentioned, to actually support the latest version of stylelint.
from gulp-stylelint.
@olegskl
Unless I am doing something wrong or I am not aware of something, npm up
does not update gulp-stylelint (because still v3.0.0) with the latest version of stylelint. Doing npm up stylelint
is not desired as it could install unsupported version of stylelint and break gulp-stylelint, you say that yourself.
We don't use stylelint for anything else other than gulp-stylelint, but as new versions of stylelint roll in, updating has to be forced through npm up stylelint
on each dev machine. Having it as peer dependency will eliminate that problem and a simple npm up
will update all packages as needed.
gulp-tslint uses tslint as peer dependency and it works just fine as they keep track of supported tslint versions.
from gulp-stylelint.
@woble I don't understand the issue.
Suppose you have gulp-stylelint v3.0.0 and stylelint v7.0.0. If stylelint releases a new minor version (for example, v7.0.1 or v7.1.0 or v7.6.8) and you do an npm update
, then what happens is that a new version of stylelint will be installed, but gulp-stylelint will stay at v3.0.0 because it's supposed to work with all minor releases of stylelint up to v7.9999.9999999-whatever.
If, however, stylelint goes to v8.x.x (a major release), then I will need to update gulp-stylelint to v.4.0.0 and when you do npm update
both stylelint and gulp-stylelint will be reinstalled.
from gulp-stylelint.
npm update
only updates packages listed in package.json, not dependencies of those packages, thus stylelint will only update if gulp-stylelint updates.
from gulp-stylelint.
Okay, I was ill-informed. I could automatically release a new version of gulp-stylelint when its dependencies change. What do you think?
from gulp-stylelint.
Wouldn't npm update --depth 1
work? Or does that have the same issue as?:
Doing
npm up stylelint
is not desired as it could install unsupported version of stylelint and break gulp-stylelint, you say that yourself.
from gulp-stylelint.
@jeddy3 Do you think that requiring stylelint as a peer dependency is better than the current approach?
from gulp-stylelint.
I dunno I'm afraid. I'm not very familiar with authoring gulp plugins. It looks like gulp-eslint
(well used with 400k monthly downloads) uses the same approach you're currently using i.e. has eslint
as a caret dependency. There appears to be a discussion for it here: adametry/gulp-eslint#68.
from gulp-stylelint.
Commit a26f7be will require stylelint as a peer dependency. Will be released in 6.0.0.
from gulp-stylelint.
Done in 36c16ee and published in 6.0.0.
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.