E
E
Evgeny Popov2017-07-15 12:55:01
Layout
Evgeny Popov, 2017-07-15 12:55:01

How to set up automatic code style checking and validation with Gulp?

Faced the problem of testing the layout, code guide, etc. I don’t understand how experienced front-end developers check a valid code guide.
After looking at some projects on github, I noticed that some use the Csscomb plugin for gulp, but it also styles the already compiled css file, and not the original sass or less files. I can’t figure out how to set it up either in the editor or in Galp so that it edits the source files. Through the editor, I get half of it, I just can’t have an indent between classes automatically (empty line)

.plan {
    background: #007090;
    .plan__title {
        padding-top: 37px;
        padding-bottom: 37px;

        font-size: 50px;
        font-family: KvalikaBold-Bold;
        text-align: center;
        color: #ffffff;
    }
    .plan__button-list {
        display: block;
        max-width: 1170px;
        margin: 0 auto;

        text-align: center;
        .plan__button {
            width: 130px;
            height: 45px;
            margin-right: 6px;
            margin-bottom: 10px;
            margin-left: 6px;
            padding: 1px 20px;

Also, many use the stylelint plugin. Do I understand correctly that it is he who does a certain test for validating css code. That is, you can first edit csscomb and then check it through stylelint, right?
And the last plugin I found is html validation 'gulp-html5-lint'. In principle, there is no question with him, but is his work relevant today?
The purpose of these questions is whether it is worth using these tools in order to somehow reduce the routine tasks of editing the code. Or are w3.org validation services better and more reliable? However, I guess if everything is properly organized through gulp, it will be faster. Focused on the starting templates of Nikolai Gromov - github.com/nicothin and glivera github.com/glivera-team . There is also an interesting project from HMLacademygithub.com/htmlacademy/codeguide , but I don’t understand how to tie it all to my project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-07-15
@sim3x

Validation from w3c is no longer in trend
Yes - linters are relevant
They are built into IDEA and can be connected separately before the git commit
Makeev - I know, akella - I know
Who is Gromov?
It is also not clear why use someone else's template - if you can file your own

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question