Why I use Prettier and ESLint on all my Javascript projects

Поделиться
HTML-код
  • Опубликовано: 31 янв 2025

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

  • @paulphilpott2232
    @paulphilpott2232 2 года назад +1

    You are the best advanced online web development educator I could find. I am looking to start something that has the potential to get pretty big and I need influencers to give us credibility and attention. Can we start a discussion? By the way, I'm also hijacking your marketing. You're now competing with all of your followers for this position. Someone reach out. We're serious. It's important.

  • @butwhothehellknows
    @butwhothehellknows 2 года назад +1

    Good job babe!!!

    • @Colstonewall
      @Colstonewall 2 года назад +1

      Me thinks Tina has a bit of a crush on Web Dev Junkie!
      Just teasing you a little, Tina.

    • @butwhothehellknows
      @butwhothehellknows 2 года назад

      @@Colstonewall lol just a wee crush 😻

  • @andrei.raducanu
    @andrei.raducanu 2 года назад +4

    I use Prettier and ESLint in my projects and it took me some time to understand what each one does but in the end it reduced the time for doing code reviews.
    Looking on public repos I saw that almost all projects use both the "eslint-plugin-prettier" and "eslint-config-prettier" and I'm not sure why. I ONLY use the "eslint-config-prettier" based on what prettier suggests (see Docs > Usage > Integrating with Linters). Also based on their suggestions we should keep Formatting rules (Prettier) and Code-Quality rules (ESLint) separately (see Docs > About > Prettier vs. Linters).
    Did I miss something about "eslint-plugin-prettier"?
    Also other recommendations:
    * Prettier vscode extension and the { "editor.formatOnSave" : true } -> automatically formats the file when you save it.
    * husky + lint-staged -> before you commit something you can run ESLint and Prettier.

  • @tamasmolnar4157
    @tamasmolnar4157 10 месяцев назад

    Hi Cody, ESLint 9.0.0 is out (breaking changes). If you have time/will, please make a video on ESLint and Prettier in a node.js typescript project (e.g. Nest.js).
    It would be really appreciated. Thanks in advance.

  • @diggingforce
    @diggingforce 2 года назад +1

    Clean

  • @Colstonewall
    @Colstonewall 2 года назад +1

    I wouldn't attempt a project without Prettier. I don't remember any type of linter like Prettier with Python. It's been a while since I wrote any Python so I could be wrong but I don't remember any tool like that. You have to write your code "pretty" the 1st time in Python.

    • @WebDevCody
      @WebDevCody  2 года назад

      python has something called 'black', and I think something else I've tried using.

    • @Dude29
      @Dude29 2 года назад +1

      There's autopep8 aswell

  • @moonchild_아포방포
    @moonchild_아포방포 2 года назад

    ERROR in [eslint] Failed to load config "prettier:recommended" to extend from.
    I've tried fixing it by using :
    npm install --save-dev eslint-config-prettier
    But the error still persists.

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

    but do you need to install the extention? becasue I think i get eslint errors even without the extention in VS code? would installing ESlint extention make the error checking more powerful?

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

    Hi, why r u using ecmaFeatures { jsx: true }, but at there are tsx files in your project?

  • @jervx829
    @jervx829 5 месяцев назад

    Have you tried dprint? it's fast. Bun even change its fmt from prettier to dprint

  • @matthew4892
    @matthew4892 2 года назад

    try setup eslint and it will enforce code styling but when i format it and save it switches back to my original indentation. ive been going back an forth on this for hours

    • @WebDevCody
      @WebDevCody  2 года назад +1

      You have to setup eslint to ignore all prettier rules, there is an extension you can use which is talked about in the prettier docs

  • @moneyfr
    @moneyfr 2 года назад

    what about stylelint

  • @moneyfr
    @moneyfr 2 года назад

    do you think i could replace sass 100% with postcss+plugins ?

    • @yopp1234
      @yopp1234 2 года назад

      Why are you considering replacing sass?

    • @Steel0079
      @Steel0079 2 года назад

      @@yopp1234 i think what he means is that he wants to switch to PostCSS.

  • @21agdmnm
    @21agdmnm 2 года назад

    its all good until you have strings with apostrophes..