Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Linter Overwhelmed With Warnings #86

Open
philsinatra opened this issue Aug 16, 2017 · 5 comments
Open

Linter Overwhelmed With Warnings #86

philsinatra opened this issue Aug 16, 2017 · 5 comments

Comments

@philsinatra
Copy link

Atom 1.19.1 x64
linter-stylint 2.2.7

The linter is highlighting everything that does not follow full CSS syntax and marking it with a warning.

Error parsing styling output
Something went wrong parsing the splint output, please see the console for details.

The console has a warning message for every single line, complaining about missing colons between property and values, leading zeros in decimals, unnecessary colons - basically everything.

It's also spitting an additional error over and over:

screen shot 2017-08-16 at 8 54 07 am

Not sure if the two are related but whatever's going on has rendered Atom unusable for anything related to Stylus at the moment.

@philsinatra
Copy link
Author

The linter will not report errors. I have a config file setup, which suppresses the infinite warning messages. However, with the config file working, the editor does not report any linting errors, even if I intentionally type a style that conflicts with a config rule.

@Arcanemagus
Copy link
Member

The first message is likely a duplicate of #74, the second message has nothing to do with this package (but if it's what I think it is, I think it's been fixed?).

However, with the config file working, the editor does not report any linting errors

If you run stylint manually on the file does it show messages?

@philsinatra
Copy link
Author

If you run stylint manually on the file does it show messages?

I am working on my configuration, but yes I can get the CLI styelint to display errors when running via the command line.

@philsinatra
Copy link
Author

Stylint version: 1.5.9

With the following file setup example:

test/
  .configrc
  test.styl

File Contents

.configrc:

{
    "rules": {
        "string-quotes": "single",
        "color-hex-case": "lower",
        "color-hex-length": "long",
        "color-named": "always-where-possible",
        "selector-combinator-space-after": "always",
        "selector-attribute-quotes": "always",
        "selector-attribute-operator-space-before": "always",
        "selector-attribute-operator-space-after": "always",
        "declaration-colon-space-before": "never",
        "declaration-colon-space-after": "always",
        "number-leading-zero": "never",
        "function-url-quotes": "always",
        "font-family-name-quotes": "always-where-recommended",
        "at-rule-no-vendor-prefix": true,
        "media-feature-range-operator-space-before": "always",
        "media-feature-range-operator-space-after": "always",
        "media-feature-name-no-vendor-prefix": true,
        "media-feature-colon-space-after": "always"
    }
}

test.styl

body.assessment
  .assessment_question_template
    @media screen and (min-width: 48em)
      display flex
      flex-direction column
      main
        order 2
      .assessment_index
        order 1

  .assessment_index
    margin-top 0.5rem
    ul
      list-style none
      margin 0
      padding 0 2rem
      display flex
      flex-wrap wrap
      justify-content flex-start
      @media screen and (min-width 48em)
        justify-content center
        padding 0
      li
        a
          border 1px solid transparent
          color cs_black
          display block
          padding 0.5rem
          text-align center
          text-decoration none
          transition all 0.5s ease
          width 4rem
          &:focus,
          &:hover
            background-color cs_gray-lightest
            border 1px solid cs_gray-lighter
          &.active
            background-color cs_blue-lightest
            border 1px solid cs_blue
          @media screen and (min-width: 48em)
            width: auto

The CLI report that comes back reads:

./test.styl
4:7    warning  missing colon between property and value          colons
5:14   warning  missing colon between property and value          colons
7:5    warning  missing colon between property and value          colons
9:5    warning  missing colon between property and value          colons
12:10  warning  missing colon between property and value          colons
12:14  warning  leading zeros for decimal points are unnecessary  leadingZero
14:10  warning  missing colon between property and value          colons
15:6   warning  missing colon between property and value          colons
16:7   warning  missing colon between property and value          colons
17:7   warning  missing colon between property and value          colons
17     warning  prefer alphabetical when sorting properties       sortOrder
18:9   warning  missing colon between property and value          colons
18     warning  prefer alphabetical when sorting properties       sortOrder
22:7   warning  missing colon between property and value          colons
22     warning  prefer alphabetical when sorting properties       sortOrder
25:6   warning  missing colon between property and value          colons
26:5   warning  missing colon between property and value          colons
27:7   warning  missing colon between property and value          colons
28:7   warning  missing colon between property and value          colons
28:17  warning  leading zeros for decimal points are unnecessary  leadingZero
29:10  warning  missing colon between property and value          colons
30:15  warning  missing colon between property and value          colons
31:10  warning  missing colon between property and value          colons
31:24  warning  leading zeros for decimal points are unnecessary  leadingZero
32:5   warning  missing colon between property and value          colons
35:16  warning  missing colon between property and value          colons
36:6   warning  missing colon between property and value          colons
38:16  warning  missing colon between property and value          colons
39:6   warning  missing colon between property and value          colons

It's linting as if the file type is .css or .scss.

If I rename .configrc ➡️ .stylelintrc the report is the same.

@philsinatra
Copy link
Author

In Atom with the default linter-stylint settings:

screen shot 2017-08-18 at 1 27 39 pm

I have the same .stylintrc configuration file in the root of my project, but the editor shows/reports no linting errors.

If I remove the .stylintrc configuration file from the project, the editor shows the same linting messages that the CLI reports inline in my file(s).

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

No branches or pull requests

2 participants