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

Add autofixing caveats explanation #2667

Merged
merged 2 commits into from Jun 26, 2017
Merged

Add autofixing caveats explanation #2667

merged 2 commits into from Jun 26, 2017

Conversation

hudochenkov
Copy link
Member

Which issue, if any, is this issue related to?

#2643 (comment)

Is there anything in the PR that needs further explanation?

Maybe we should even tweet about this, because it's pretty serious caveat.

@hudochenkov
Copy link
Member Author

Users can use this trick for npm scripts to run stylelint twice :)

{
  "name": "project",
  "scripts": {
    "lintcss": "npm run postlintcss",
    "postlintcss": "stylelint . --fix"
  }
}

@@ -80,6 +80,10 @@ Linting all `.css` files in the `foo` directory. And fixing source files if viol
stylelint "foo/*.css" --fix
```

**Note:** It's an _experimental_ feature. It ignores special comments for disabling stylelint within style sheet (e. g. `/* stylelint-disable /*`). It means autofixing will apply regardless of these comments.

If you're using both these special comments and autofixing, please run stylelint twice. On the first run, some violations could be missed, or some violations might be reported incorrectly. It's a temporary solution until stylelint learn to respect these comments.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"It's an experimental feature. It currently does not respect special comments for disabling stylelint within sources (e. g. /* stylelint-disable /*). Autofixing will be applied regardless of these comments."

"If you're using both these special comments and autofixing, please run stylelint twice as a temporary solution. On the first run, some violations could be missed, or some violations might be reported incorrectly."

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

Successfully merging this pull request may close these issues.

None yet

2 participants