Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Feature Request - option for lint on deploy and let deploy fail if lint has errors #944

Closed justinmetros closed 5 years ago

justinmetros commented 5 years ago

Problem

No problem, just an idea.

Replication steps

N/A

More Information

I know this can be done in a ton of other ways. Modifying slate.config.js and adding some new tools.

But it would be cool if you could eject from a deploy if lint had any errors as a default feature ( or a warning - you have lint errors deploy y/N ).

justinmetros commented 5 years ago

I just finished making our codebase compliant with Shopify's eslint and stylint plugins / extends.

A few personal preference overrides but for the most part I really like them.

Would be awesome if no one on our team could deploy if they jam in some css or js and lint fails.

t-kelly commented 5 years ago

The beauty of NPM scripts is they can be whatever you want. You should be able to achieve this by replacing the deploy script with something like slate-tools lint && slate-tools build && slate-tools deploy

justinmetros commented 5 years ago

Thanks @t-kelly - yeah this is how i was doing it. I didn't quite get to how to skip the slate-tools deploy if slate-tools lint failed. Even when slate-lint throws errors, it continues to next script.

You sparked the idea though to use slate-tools lint just on the liquid and add my own js/(s)css lint that pulls the ripcord on an error.

Appreciate the feedback, thank you! Not sure if I'm doing this the 'slate way' but got it working for now :)

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.