-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
Fix isPathIgnored regression for .stylelintignore files #2833
Comments
@proProbe |
@evilebottnawi Oh Im sorry, I incorrectly wrote .gitignore instead of .stylelintignore in the title. Changed that now |
@proProbe for api you can use stylelint.lint({
config: { ...confguration, ignorePath: '/path/to/ignore-file' },
files: "all/my/stylesheets/*.css"
})
.then(function(data) {
// do things with data.output, data.errored,
// and data.results
})
.catch(function(err) {
// do things with err e.g.
console.error(err.stack);
}); |
@shinnn I'm kinda new to this. Any of the above suggestions that can be used? |
@proProbe The easiest way to handle this is to ask stylelint to tell you whether the file is ignored before attempting to run a lint: Note that in our usage we have already asked for the configuration and handled any errors that would throw, otherwise you need to handle that here. |
No. |
@shinnn ? So the stylelint API isnt broken? The code just need to be fixed? |
It is broken but stylelint team doesn't seem to understand it because of your poor explanation.
Yes, the code of stylelint should be fixed. |
@shinnn I guess I dont understand the problem well enough :) maybe you could help improving the ticket so we might solve this? it seems like the atom linter works so why shouldnt the vscode? |
|
Okay, there are two things going on here. @evilebottnawi it seems that they are unintentionally correct: Back when AtomLinter/linter-stylelint#251 was closed though it seems that it was working as the test files from #1981 used a @shinnn It seems tl;dr: |
@Arcanemagus thanks! |
Pre 8 when I called lint it would ignore my file if the path was matched, now it does not. this issue seems to be related to my problem. I have negotiated the issue temporarily by ignoring it manually. billybonks/broccoli-stylelint#34 it seems a potential fix would be to add |
@billybonks Thanks for digging deeper! If you find time, would you be able to contribute such a fix? |
sure ill add create a pr today. |
Any update on the progress of this fix? |
gulp-stylelint and VSCode plugin .stylelintignore is also not working and I think it's related to this issue. |
I've been looking into this issue, and from what I've understood so far it actually seems like the API and the CLI work the same. The difference might only be in how both are used. Would be nice if someone who is more familiar with the codebase than I am can verify my analysis. Here is the code I think is causing this: Lines 49 to 55 in 2301a48
The problem is with If Alternatively, I imagine it would also be possible to change how If anyone else wants to look into this, I've made a repository that has everything set up to try this out easily: https://github.com/thibaudcolas/stylelint-repro. |
I'm gonna go ahead and say this is the least bad option. In scenarios where it isn't desirable, it's possible to add the We should also add some documentation around I've been looking to pair remote with someone (hangouts + teletype) as a way of getting more familiar with the stylelint core so that at least someone knows how it works. If you @thibaudcolas or anyone from @stylelint/core has any interest maybe we could tackle this next week ... |
SGTM.
I'd be keen to understand the core more as I'm a lot more familiar with the rules than the engine itself. I suspect your JavaScript is stronger than mine @CAYdenberg, but I might know some of the historical design decisions that could help us out. I can make some time this weekend if you're around? |
Days change everything in the freelancers world and now I'm struggling to hit deadlines for paid work. So I'll have to take a rein check. I'll ping you in Sept on the contributors channel. |
Unfortunately no. #3590 (comment) |
I totally understand. I freelance too :)
Sounds like a plan. |
Looking at this issue again, I see that (at least according to the title) this is explicitly about
What I have trouble understanding is why there are separate implementations of this ignoring logic:
|
This should remain open until |
There is a bug where the API apparently doesnt read .stylelintignore-files. CLI works fine but not the API.
no rule
No actual css
doesnt matter
^8.0.0
In vscode with
https://github.com/shinnn/vscode-stylelint
Nope
That the API adheres to the stylelintignore
All my files gets linted through the API even though they do not get linted in the CLI
I created an issue on the vscode-stylelint repo. The author stated that there is a problem with the API. The CLI works as expected though.
https://github.com/shinnn/vscode-stylelint/issues/101#event-1219431167
The text was updated successfully, but these errors were encountered: