userfrosting / UserFrosting

Modern PHP user login and management framework
https://www.userfrosting.com
Other
1.64k stars 366 forks source link

Add CSS linter to gulp tasks #797

Closed alexweissman closed 4 years ago

alexweissman commented 7 years ago

It's possible to write malformed CSS that can be properly interpreted by most browsers, but will cause problems when passed through the minification process. As a result, you can end up with styling that worked fine in development, but fails in production.

Adding a CSS linter to the build pipeline would ensure that problems like this are flagged, rather than silently breaking styling when you deploy malformed CSS.

splitt3r commented 7 years ago

We should add https://scrutinizer-ci.com/ to lint js, css and php at once 💪

alexweissman commented 7 years ago

Is this something we can easily integrate into GitHub?

splitt3r commented 7 years ago

You only have to register and add the repository. It checks the code on every commit / pr etc. just like Travis does with the builds.

Silic0nS0ldier commented 5 years ago

Having some service to lint this project as a whole would be a good idea however the benefits would be limited to us.

I've been thinking about this for some time now, and I think the best solution here would be allowing custom scripts in each sprinkle. Work done for 4.2 (common frontend dependencies location, much like how we resolve backend dependencies via composer to a common location) opens up node_modules as a safe location to have in a sprinkle.

In terms of linting CSS the thought process is that we have a default linter that can be run, but allow individual to override this with their own.

I'd like to see this expanded with a few build hooks to better facilitate more complex build process in time, that however will be much more complex as ~dev~ debug mode will need to be considered. Before something this complex could even be attempted, caching (#938) would need to be implemented first. This is best discussed in another issue, but the goal would be supporting custom frontends that use React, Vue, etc which have seen a surge in popularity. V5 will provide first class support, but we may as well support it in UF4.X is we can.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexweissman commented 3 years ago

Does style-ci handle this now?

Silic0nS0ldier commented 3 years ago

Not that I've noticed. Could be a config thing (adding support that is automatic opt-in would be annoying for existing users as it would break builds).