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

Possible regression with "duplicates" in 1.3.9 #299

Closed jackbrewer closed 8 years ago

jackbrewer commented 8 years ago

Hi, I've noticed some duplication warnings appearing after updating Stylint to latest.

The problem is with a multi-line selector, which doesn't use a separating comma. I remember the issue being raised in #58 but was marked as 'wontfix'. This has me a little confused, as I use this format all the time, but have only started receiving warnings as of 1.3.9.

Can you confirm whether 1.3.9 introduced a regression, or whether it in-fact introduced a fix which happens to dislike my preferred style?

example.styl

.foo
.bar
  color red

.foo
  border-color green

.bar
  border-color blue

.stylintrc

{
  "duplicates": true
}

Result using Stylint 1.3.8: Passes

Result using Stylint 1.3.9: 2 Warnings

Warning: duplicate property or selector, consider merging
File: stylint-test.styl
Line: 5: .foo

Warning: duplicate property or selector, consider merging
File: stylint-test.styl
Line: 8: .bar

Stylint: 0 Errors.
Stylint: 2 Warnings.
rossPatton commented 8 years ago

not aware of a regression, but basically stylint just wants this syntax

.foo, <---
.bar
  color red

.foo
  border-color green

.bar
  border-color blue

without the comma, it just looks like repeating selectors

i would gladly welcome any prs that would improve this, if you have any ideas

ryuran commented 8 years ago

@rossPatton stylint want it but stylus doesn't need it so, user want choose the rule. I think this issue should stay open if this code throw a warning.

.foo
.bar
  color red

.foo
  border-color green

.bar
  border-color blue
rossPatton commented 8 years ago

again, I understand stylus supports no commas, but this is how it is currently. if you want to improve stylint i am very very open to prs or even giving people push access. i would love it if more people contributed or took over the project

ryuran commented 8 years ago

A linter shouldn't throw false error or warning. A linter shouldn't throw error or warning for something valid in the language and no choose by config.

So it's a bug. It's a bug or an enhancement to do. An issue should be closed if someone fix it. Maybe me if I have time to do it.

Without fix, issue should stay open to stay visible to other people.