SimenB / stylint

Improve your Stylus code with Stylint
https://simenb.github.io/stylint/
GNU General Public License v2.0
348 stars 61 forks source link

"valid" and "brackets": false positives on Stylus hashes #464

Open TokugawaTakeshi opened 3 years ago

TokugawaTakeshi commented 3 years ago

Below expression is absolutely valid for Stylus. Its a mixin invocation with object (called "hash" in stylus) parameter:

provideImprovedListComponent({
  positionalRelationship: {
    withTypographyElements: {
      typographyProperties: ArticleTypographyProperties
    }
  }
})

With rules "valid" and "brackets", I have 11 warnings only for this expression::

  line 11  -  property is not valid    provideImprovedListComponent({
  line 12  -  unnecessary bracket      positionalRelationship: {
  line 12  -  property is not valid    positionalRelationship: {
  line 13  -  unnecessary bracket      withTypographyElements: {
  line 13  -  property is not valid    withTypographyElements: {
  line 14  -  unnecessary colon found  typographyProperties: ArticleTypographyProperties
  line 14  -  property is not valid    typographyProperties: ArticleTypographyProperties
  line 15  -  unnecessary bracket      }
  line 16  -  unnecessary bracket      }
  line 17  -  unnecessary bracket      })
  line 17  -  property is not valid    })

property is not valid

From the documentation of valid rule:

"Check that a property is valid CSS or HTML.".

Here is not a CSS property.

unnecessary bracket

From the documentation of brackets rule

When 'always', expect {} when declaring a selector.

Here is not a selector.

Because hashes is basic functionality in Stylus, I can't understand if you answer something like "We don't support hashes".