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

Attribute values throwing warning #212

Closed
PalleZingmark opened this issue Oct 19, 2015 · 12 comments
Closed

Attribute values throwing warning #212

PalleZingmark opened this issue Oct 19, 2015 · 12 comments
Labels

Comments

@PalleZingmark
Copy link
Contributor

Using v1.2.3:

div:not([style="display: block;"]) {
  display: none;
}

-> Warning: avoid one liners. put properties on their own line

@rossPatton rossPatton added the bug label Oct 20, 2015
@rossPatton
Copy link
Collaborator

@PalleZingmark can i get more information about your config? i am not seeing this locally. ie, that selector is not tripping up the stackedProperties option, at least with how my config is currently set up.

@PalleZingmark
Copy link
Contributor Author

@rossPatton Certainly, here´s how it's setup:

gulp v3.9.0
gulp-shell v0.5.0
stylint v1.2.3

gulpfile.js

gulp.task("stylint", shell.task([
  "stylint ./app/assets/stylus/ -c .stylintrc"
]));

.stylintrc

{
  "blocks": false,
  "brackets": "always",
  "colons": "always",
  "colors": "always",
  "commaSpace": "always",
  "commentSpace": "always",
  "cssLiteral": "never",
  "depthLimit": 4,
  "duplicates": true,
  "efficient": "always",
  "extendPref": false,
  "globalDupe": false,
  "indentPref": 2,
  "leadingZero": "never",
  "maxErrors": false,
  "maxWarnings": false,
  "mixed": true,
  "namingConvention": "BEM",
  "namingConventionStrict": true,
  "none": "never",
  "noImportant": true,
  "parenSpace": "never",
  "placeholders": "always",
  "prefixVarsWithDollar": "always",
  "quotePref": "double",
  "semicolons": "always",
  "sortOrder": false,
  "stackedProperties": "never",
  "trailingWhitespace": "never",
  "universal": false,
  "valid": true,
  "zeroUnits": "never",
  "zIndexNormalize": false
}

@rossPatton
Copy link
Collaborator

thanks, i'll take another look tonight

@rossPatton
Copy link
Collaborator

still can't replicate this.

i've tested the following ways with your config:

  • locally via cli
  • locally via gulp
  • locally used directly
  • using 1.2.3 cli
  • using 1.2.3 via gulp
  • using 1.2.3 directly

sorry to not be more help.

closing for now (if anyone else has this issue I will re-open).

@PalleZingmark
Copy link
Contributor Author

@rossPatton This is so weird. I've tested this issue now on 5 different setups and they all generate the same warning. -> Warning: avoid one liners. put properties on their own line

Here is the exact code I've tested on: https://www.dropbox.com/sh/5f531dyxiosb66e/AAC3YDwbH6R9ImwPvhUqy9dFa?dl=0

  1. cd stylint-test
  2. npm install stylint
  3. stylint test.styl

image

@carsotho
Copy link

I also get this bug when running @PalleZingmark test case with stylint 1.2.5, with Node 0.12.7 on Mac OSX 10.10.5

@PalleZingmark
Copy link
Contributor Author

Found another interesting issue regarding Warning: avoid one liners. put properties on their own line today, not sure it's really related to this issue, but I'll post here first instead of opening a new issue.

I used the same setup, but with this code:
(note: there is a white-space after display: block; as better seen in the screenshot)

.foo {
  display: block; 
}

Warning: avoid one liners. put properties on their own line, Line: 2: display: block;
Warning: trailing whitespace, Line: 2: display: block;

And when I removed the whitespace, I got no warnings at all.

image

@rossPatton
Copy link
Collaborator

that is very weird. hmmm

@PalleZingmark
Copy link
Contributor Author

If I look at Line 4 in stylint/src/checks/stackedProperties.js, does that regexp take a trailing whitespace into the calculation?

// if semicolons on line, but not ending the line, prolly a one-liner
var semiTest = /;+(?!$)/gm

@rossPatton
Copy link
Collaborator

prolly not. i trim my trailing whitespaces by default (via sublime settings) so most likely i missed that case

@rossPatton
Copy link
Collaborator

so, this wasn't in the latest release (1.3.0) but i hope to get to it for 1.3.1

@rossPatton
Copy link
Collaborator

this should be fixed in 1.3.2

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

No branches or pull requests

3 participants