I Do this for every commit and why you should too!

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • I know, I know, every single time you try to commit your code to your version control for the other senior developer to review or deploy, you stumble upon an ugly and tedious process of running ESLint before commits and making sure it aligns with some code conventions, or even, you make sure it follows the right conventions for your team for writing commit messages!
    Well, I figured out an exciting way how to automagically run ESLint and a bunch of other scripts for every commit as well as running linters for your commit messages as well!
    ⭐ Timestamps ⭐
    00:00 Intro
    01:08 How do we usually commit our code?
    02:50 How do we want it?
    04:02 Using lint-staged
    06:39 Linting commit messages
    🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize
    • Build Login/Register A...
    🧭 Turn Design into React Code | From prototype to Full website in no time
    • Turn Design into React...
    🧭 Watch Tutorial on Designing the website on Figma
    • I Design a onecolor We...
    🧭 Watch Create a Modern React Login/Register Form with smooth Animations
    • Create a Modern React ...
    🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools
    • Debug React Apps Like ...
    🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React
    • Master React Like Pro ...
    🧭 Learn Redux For Beginners | React Redux from Zero To Hero to build a real-world app
    • Debug React Apps Like ...
    🧭 Introduction to GraphQL with Apollo and React
    • Introduction to GraphQ...
    🐦 Follow me on Twitter: / ipenywis
    💻 Github Profile: github.com/ipenywis
    Made with 💗 by Coderone

Комментарии • 26

  • @TormentaNocturna
    @TormentaNocturna 11 месяцев назад +1

    Thank you for your explanation. Excellent video.

  • @Leyksnal
    @Leyksnal Год назад +2

    I really learn a lot from watching this video such that i want to watch again and again because I'm still trying to set up the whole thing for the first time , please can you make another video to talk more on setting it up from scratch on a new project. Thanks

  • @MrJoaopaulofurtado
    @MrJoaopaulofurtado Год назад +5

    I like the idea of linting comments, but my impression is that its just "one more thing" to slow people down.

  • @bobdpa
    @bobdpa Год назад

    Awesome stuff

  • @rahulreddy-ynr
    @rahulreddy-ynr Год назад

    ❤awesome man

  • @dealloc
    @dealloc Год назад +5

    Blocking commits encourages people to create large commits, rather than smaller refined ones, because no-one wants to wait around for your darn linting and type checking. It slows your workflow and train of thought.
    If you don't want to include fix commits like "typo" and "formatting", use rebase to clean up your commits when it's ready for review, and amend commits.
    At maximum I consider a non-blocking commit lint rule like prettier and only run it on changed files-but my editor does this anyway. Everything else like ESLint and TypeScript are slow because they have to run across your entire codebase in order to catch actual issues. Use your editor and CI pipeline to get notified about errors and warnings before merging your pull requests.

  • @3aQaRyAn
    @3aQaRyAn 9 месяцев назад

    Thank's😉😉

  • @Shuyinz
    @Shuyinz Год назад +1

    The git commit linting is very useful! How can you Config if you want the git commit starts for example "GS-123" before using "add: new card", so it would be like "GS-123 add: new card"?

  • @regilearn2138
    @regilearn2138 Год назад +1

    hi pls do,updated video on set up linter,prettier,huzki for react app anf include this also

  • @theshubhampatidar
    @theshubhampatidar Год назад

    Hello, Can you please share the Extention list ??

  • @rishiraj2548
    @rishiraj2548 Год назад

    Good day

  • @nanangkho9378
    @nanangkho9378 Год назад

    What theme vscode ?

  • @drdev_blog
    @drdev_blog 3 месяца назад

    2024 it doesnt work like this, Inctead use:
    create commit-msg file im the .husky folder and add
    npx --no -- commitlint --edit \
    there and delete pre-commit file

  • @tomaszp2580
    @tomaszp2580 Год назад +1

    No you not need it. Fot sure if you squash commits. If you want do something like this better to move it to ci piplines.

  • @sarcasticdna
    @sarcasticdna Год назад +3

    @theo will disagree with you 😅

    • @RaZziaN1
      @RaZziaN1 Год назад +1

      theo was talking about linting everything, in this case u are linting only staged.

    • @ky3ow
      @ky3ow Год назад +1

      @@RaZziaN1 its still blocking developer from commiting his work, even if its temporary commits that won't be pushed anywhere, so it seems really annoying

  • @anhdunghisinh
    @anhdunghisinh Год назад +3

    Man @Theo will get cringe at this video.
    Don't do this mate, what you should do is create a lint CI CD on server, not on local. Doing this on local will block everyone in your team and slow them down, the dev will throw middle finger behind your back in no time.
    Unless you are working on a project alone, this is a very stupid idea to do.

    • @devcoelho
      @devcoelho Год назад

      It is to keep the code style in sync, I guess

    • @anhdunghisinh
      @anhdunghisinh Год назад

      @@devcoelho nah, you want the code style get sync? Let people manually change the config, don't let the linter control it. The config you change once and it will always be the things you want, but with the linter, it will run everytime, even if your code is already clean.
      Also i said move the linter to the github action or sth similar, it run on server and only run when you push, reduce the time linter have to run a lot.

    • @matheusestevao9870
      @matheusestevao9870 4 месяца назад

      You all riding Theo like a fucking religious cult.

  • @alext5497
    @alext5497 Год назад +4

    Uninstaller prettier is the best decision I ever made