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

Sometimes warning for CSS syntax are not shown #155

Closed
hudochenkov opened this issue Apr 30, 2019 · 2 comments · Fixed by stylelint/stylelint#4315 or #177
Closed

Sometimes warning for CSS syntax are not shown #155

hudochenkov opened this issue Apr 30, 2019 · 2 comments · Fixed by stylelint/stylelint#4315 or #177

Comments

@hudochenkov
Copy link
Member

Given CSS:

div {
  background-image: url(
    "data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 9l5 5 5-5z'/></svg>");
}
div {
  background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 9l5 5 5-5z'/></svg>"
  );
}

.hello {
  background-image: url("data:image/svg+xml;utf8,\
    <svg fill='black' height='24' \
    viewBox='0 0 24 24' width='24' \
    xmlns='http://www.w3.org/2000/svg'\
    ><path d='M7 9l5 5 5-5z'/></svg>");
}

Config:

{
  "rules": {
    "max-line-length": 50,
    "string-no-newline": true
  }
}

Demo with syntax set to Scss, and CLI (with autodetected syntax, which is CSS) show following warnings:

  3:159  ✖  Expected line length to be no more than 50 characters   max-line-length  
  6:177  ✖  Expected line length to be no more than 50 characters   max-line-length  
 11:51   ✖  Unexpected newline in string                            string-no-newline

But demo with syntax set to CSS shows: “✔ No warnings”.

@hudochenkov
Copy link
Member Author

This is because we don't have --syntax css. And without syntax specified, postcss-syntax gueses it. We need to add --syntax css to stylelint.

@hudochenkov hudochenkov added the status: blocked is blocked by another issue or pr label Sep 5, 2019
@hudochenkov hudochenkov reopened this Oct 1, 2019
@hudochenkov hudochenkov added pr: blocked is blocked by another issue or pr and removed status: blocked is blocked by another issue or pr labels Oct 1, 2019
@hudochenkov
Copy link
Member Author

Waiting for a stylelint release.

@hudochenkov hudochenkov removed the pr: blocked is blocked by another issue or pr label Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant