pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

require-disallow pair ambiguity in config #38

Closed gergelykovacs closed 8 years ago

gergelykovacs commented 9 years ago

Ambiguity!

Contradiction in config options e.g.,

{
    "disallowClassLiteralsBeforeAttributes": true,
    "requireClassLiteralsBeforeAttributes": true,
    "disallowClassLiteralsBeforeIdLiterals": true,
    "requireClassLiteralsBeforeIdLiterals": true,
    "disallowIdLiteralsBeforeAttributes": true,
    "requireIdLiteralsBeforeAttributes": true
    ...
}

Could you clarify and clean up configuration options to avoid such scenarios?

benedfit commented 9 years ago

I've followed the JSCS model of naming rules, and that too allows you to essentially create a config that contradicts itself, but will look at implementing functionality to associate pairs with one another and ignore further config values if one of a pair is already set

e.g.

{ "disallowClassLiteralsBeforeAttributes": true
, "requireClassLiteralsBeforeAttributes": true
}

would result in requireClassLiteralsBeforeAttributes being null