pugjs / pug-lint

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

Latest changes to clock preset cause broken builds post v2.1.8 #80

Closed rollbrettler closed 8 years ago

rollbrettler commented 8 years ago

Introduced with the update from patch version v2.1.8 to v2.1.9 you introduced new validation rules, which actually can break builds. This could be seen as a addition to current behavior so it should raise the minor version instead of the patch version.

See: https://github.com/pugjs/pug-lint/compare/v2.1.8...v2.1.9#diff-a916af6f3b09319c594cc1659fd03a6cR33

benedfit commented 8 years ago

Hi @rollbrettler, thanks for bringing this to my attention. Do the additional errors relate to the changes made to the "clock" preset? (https://github.com/pugjs/pug-lint/compare/v2.1.8...v2.1.9#diff-a916af6f3b09319c594cc1659fd03a6cL16)

rollbrettler commented 8 years ago

Yes, exactly. In my case it was only https://github.com/pugjs/pug-lint/compare/v2.1.8...v2.1.9#diff-a916af6f3b09319c594cc1659fd03a6cR33 but as far as I can see all changes in that file are additional rules.

benedfit commented 8 years ago

Unfortunately, this is down to the misassumption on my part that anyone outside of @clocklimited would be using that particular preset, as in all honestly it is in flux given that many rules are still to be added to pug-lint 😄 Sorry about that!

While in hindsight bumping the minor version would have been the appropriate course of action, I'm going to suggest that you adjust your config to revert those values that were changed in this commit.

I'm suggestion this because work is afoot in #79 to deprecate presets in favour of the ability to extend configs from external locations in the same way eslint. I'll keep you posted as to when this feature drops, and provide instructions on how to get back to the config you have previously when it does

rollbrettler commented 8 years ago

Thanks for the heads up.

I solved the issue by following the linter and adding the missing attribute, which I love to do. I like to have one source of truth for linting unless Iam fully aware of what I do. On the otherside I also want to fix new linting rules only when updating minor or major versions so I know I have the time to do so 😉 Thats basically the whole reason to add a ticket in the first place. Thanks again for your fast response 🙇 !

benedfit commented 8 years ago

I'll shortly be publishing v2.2.0 This version will deprecate preset in favour of extends in order to get your build back to the state it was in v2.1.8 You can install the following:

npm install --save-dev pug-lint@2.2.0
npm install --save-dev pug-lint-config-clock@1.0.1

And update your .pug-lintrc file as follows:

{
- "preset": "clock"
+ "extends": "clock"
...
}
rollbrettler commented 8 years ago

So updating to v2.2.0 means "preset": "clock" does not work anymore, right? That actually means that https://github.com/pugjs/pug-lint/pull/82 introduces breaking changes and is not backwards compatible. Which calls for a major version bump!? What do you think?

TimothyGu commented 8 years ago

@rollbrettler, it still does, but its usage is not encouraged. So no, it's a minor bump.