-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support .stylelintignore file #257
feat: support .stylelintignore file #257
Conversation
|
Codecov Report
@@ Coverage Diff @@
## master #257 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 219 227 +8
Branches 51 53 +2
=========================================
+ Hits 219 227 +8
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my option, stylelint should have API to do it, otherwise they can change logic and it will be problem for us, we need ping somebody from stylelint here
Any advices? I haven't worked directly with api for a long time, so maybe I'm missing something, thanks
@alexander-akait You're right |
Hi @BlackHole1 |
hi @ricardogobbosouza , I have an example to describe why this should be done. Please reopen this pr and I'll submit a |
@BlackHole1 Please share a repository where this issue occurs. So I can reanalyze the PR |
okey |
On its own, it is fine to decouple the logic of the plugin from Since this plugin is for stylelint, our handling of it will make the whole behaviour more uniform. From a developer's (user's) point of view, I don't think many people want to maintain two sets of essentially the same thing |
For example, I'll use vscode-stylelint as an example: https://github.com/stylelint/vscode-stylelint/blob/59be6cc89d04ed5efaf122c838ac31003d15de4f/src/extension/extension.ts#L38 This plugin recognises |
Ideally stylelint should iself ignore them (i.e. loader .stylelintignore and do not report warnings/errors for these patterns), maybe we forget something to setup? |
In stylelint, this error is expected. see: cc: @alexander-akait |
Perhaps I should submit a PR to stylelint to add an option to control whether or use |
I think it s good way, let's open an issue and discuss it, I'm not against it, I just would like to avoid duplicate code and found valid way to solve it |
@BlackHole1 In your https://github.com/BlackHole1/stylelint-webpack-plugin-PR-257 repo, if we run We shouldn't treat it differently. And if we don't have stylesheets to lint, it doesn't make sense to have the plugin configured, don't you think? |
I agree:
But this is because I only have one css file, if I had two css files then the situation would be different |
Oooh, Sorry. Their behaviour is consistent |
I'm sorry I didn't add some details. I've only just recalled the full details because it's been a bit too long. Please wait a moment while I refine the entire description of the problem. |
If I have 2 or more files and they are all ignored then I don't have any. But if I have at least 1 valid file, it will go through lint normally. |
The problem is with When a user starts watch and modifies an ignored css file, they will get an error |
Ok. When watching we have this problem |
I've come up with an idea to get around this error by passing in the allowEmptyInput parameter when the current mode is watch. |
But I think it's not the most ideal |
Oh? Can you describe your reasoning?🧐 Because it seems to me that this is a way to be consistent with Can you describe, ideally, the situation? We can always discuss how to do that. 🙇 |
Hi there, I'm a maintainer of Stylelint. ✋🏼 Maybe, Of course, you can also open an issue to suggest a new API for the case. Here are the discussion issues about new APIs: |
My thought is, that if the file is skipped, it shouldn't go through lint even in watch mode. |
Perhaps we should export |
The |
Good idea. I'll submit a PR to |
This PR contains a:
Motivation / Use-Case
#105