Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Integration with webpack? #58

Closed
emilgoldsmith opened this issue Jul 6, 2017 · 7 comments
Closed

Integration with webpack? #58

emilgoldsmith opened this issue Jul 6, 2017 · 7 comments

Comments

@emilgoldsmith
Copy link
Member

Hey, are there any good solutions for integration with webpack yet? Can't find anything suitable online as it's all meant for scss etc.

Otherwise I might build one.

@ismay
Copy link
Member

ismay commented Jul 6, 2017

Depends, what kind of integration are you looking for? You wont have to compile anything and linting can just be done from the commandline with stylelint.

@emilgoldsmith
Copy link
Member Author

I meant like eslint-loader so that it'll show up in webpack-dev-server when using hot-reload.

@ismay
Copy link
Member

ismay commented Jul 7, 2017

I think this should do what you're looking for: https://www.npmjs.com/package/stylelint-webpack-plugin

It accepts a regular stylelint config, so you should be able to define the processor there. I'll close this as I think this should solve it, but please let me know if this doesn't work as expected.

@ismay ismay closed this as completed Jul 7, 2017
@emilgoldsmith
Copy link
Member Author

Yeah @ismay I looked at that one already and I feel like it's a quite unnatural implementation (of top of it not working at all for styled components as it looks for .css (or scss and the other extensions) files, not js). It's a plugin not a loader which means it kinda does something very separate from Webpack. I guess one could write a plugin that simply just runs something similar to the yarn lint:css that you can easily write, but what I'd love is something like [eslint-loader](That might be possible in some cases, but ultimately I think it would be quite difficult. Some values would only be available at runtime if I'm not mistaken and there would probably be quite a performance hit.) that would just pretty much apply this package to any .js(x) file it sees, and I guess there's nothing like that out there at the moment.

So yeah, I may write a small package, it seems to be quite light weight.

@ismay
Copy link
Member

ismay commented Jul 7, 2017

Yeah @ismay I looked at that one already and I feel like it's a quite unnatural implementation (of top of it not working at all for styled components as it looks for .css (or scss and the other extensions) files, not js).

Ah ok, I didn't take a thorough look, but yeah that's not helpful then.

So yeah, I may write a small package, it seems to be quite light weight.

Cool! Would be nice! Probably worth adding it to the docs here if you're publishing it.

@emilgoldsmith
Copy link
Member Author

Cool! Would be nice! Probably worth adding it to the docs here if you're publishing it.

That was also the plan! :).
As I was doing a bit of extra research for it I actually found a deprecated package that works exactly how I want it to though. I had first not tried it as it was deprecated a year ago and had just followed the links it gives, but now I've tried the two links it gives and both don't work for our purposes as they both assume (and therefore break without it) css files! While the deprecated package actually uses the stylelint processor given to it (as we want it to). But yeah I tried installing the deprecated package and it actually works just the way I want it haha. I'll see if I either just fork that package and become the new maintainer or I build a new one from scratch as it's not that big a deal, because I of course don't want a deprecated package as a dependency.

@emilgoldsmith
Copy link
Member Author

Though I also don't really like the way the deprecated package outputs errors and stuff.

But yeah I'll definitely look at it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants