Skip to content
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

.stylelintignore doesn't work but ignoreFiles option in .stylelintrc.js works! #155

Open
waantony opened this issue Dec 22, 2020 · 2 comments
Labels
status: blocked is blocked by another issue or pr type: bug a problem with a feature or rule upstream relates to an upstream package
Projects
Milestone

Comments

@waantony
Copy link

Clearly describe the bug

.stylelintignore in project root directory didn't work but ignoreFiles option in .stylelintrc.js worked!

What code is needed to reproduce this issue?

CSS:

/* .../components/test.css */

.test1,.test2{
  padding: 0px;
}

Use ignoreFiles option in .stylelintrc.js file:

// .stylelintrc.js

module.exports = {
  // ...
  ignoreFiles: ['**/components/**'],
}

It works:

image

Use .stylelintignore file:

# .stylelintignore

**/components/**

It doesn't works:

image

What vscode-stylelint configuration is needed to reproduce the bug?

{}

Is this issue related to autofix? (editor.codeActionsOnSave)

"No"

Which version of vscode-stylelint are you using?

0.85.0

Which version of stylelint are you using?

13.8.0

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

"No"

What did you expect to happen?

.stylelintignore works

@adalinesimonian adalinesimonian added this to Needs triage in Bugs Nov 2, 2021
@adalinesimonian adalinesimonian added type: bug a problem with a feature or rule status: needs investigation triage needs further investigation labels Nov 2, 2021
@adalinesimonian adalinesimonian added status: blocked is blocked by another issue or pr upstream relates to an upstream package and removed status: needs investigation triage needs further investigation labels Nov 15, 2021
@adalinesimonian adalinesimonian moved this from Needs triage to Low priority in Bugs Nov 15, 2021
@adalinesimonian
Copy link
Member

Looks like the issue is that Stylelint looks in process.cwd() as a starting point to resolve .stylelintignore. However, the extension isn't running in the same directory as where you would be running Stylelint if you were running it from the CLI. As a result, Stylelint doesn't locate .stylelintignore.

ESLint has a cwd option in the API which allows API users, such as the ESLint extension, to specify what the effective working directory should be. However, Stylelint does not have such an option, at least not to my knowledge.

I've opened an issue upstream at stylelint/stylelint#5720

@adalinesimonian adalinesimonian added this to the v1.3.0 milestone Nov 18, 2021
@adalinesimonian adalinesimonian added this to To do in v1.3 via automation Nov 18, 2021
@mrkpatchaa-sf
Copy link

Hi @adalinesimonian are you planning to release 1.3 soon?
Thanks.

@ota-meshi ota-meshi modified the milestones: v1.3.0, Backlog Aug 17, 2022
@ota-meshi ota-meshi removed this from To do in v1.3 Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked is blocked by another issue or pr type: bug a problem with a feature or rule upstream relates to an upstream package
Projects
Bugs
Low priority
Development

Successfully merging a pull request may close this issue.

4 participants