Тёмный

Lint Staged With Husky for Pre-commit Validations 

Monsterlessons Academy
Подписаться 46 тыс.
Просмотров 22 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@MonsterlessonsAcademy
@MonsterlessonsAcademy 24 дня назад
WATCH NEXT: Javascript Interview Questions and Answers - Dominate Your Next Interview - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-wnYKH2dO620.htmlsi=5DfbGEfhXWiiv0a_
@karthikeyan878
@karthikeyan878 2 года назад
Thank you so much for post the requested video. We want a video with Angular project.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
I will add it to the list of ideas
@damagee8141
@damagee8141 2 года назад
For anyone watching this video: Remember not to install eslint, lint-staged, husky and prettier as dependencies but as devDependencies instead.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
You are totally right but only if people install later packages for prod only.
@wojts7212
@wojts7212 Год назад
amazing explanation, thanks. Very high quality content, keep going bro
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Glad you liked it!
@feeelgoood
@feeelgoood Год назад
one more good Oleksandr's lesson
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Thank you!
@Issanjeewa
@Issanjeewa Год назад
Great explanation, thanks 👍👍
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Glad it was helpful!
@playyourway2963
@playyourway2963 Год назад
Thank you Sir ! clean & short ♥you earn my sub
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Welcome!
@arnaldoceballos4653
@arnaldoceballos4653 5 месяцев назад
Hello, question...in an Angular project, how can you execute the scripts defined in package.json in a git hook? For example, if you define in .lintstagedrc { "src/**/*.{ts,html}": "npm run lint" } and in package.json the script "lint": "ng lint", it does not recognize the command
@MonsterlessonsAcademy
@MonsterlessonsAcademy 5 месяцев назад
Unfortunately I don't help with debugging custom problems in RU-vid comments.
@arnaldoceballos4653
@arnaldoceballos4653 5 месяцев назад
@@MonsterlessonsAcademy My question is if in an Angular project it is possible from lint-staged to run the scripts defined in package.json. I couldn't achieve this.
@KunjVaishnani-j7s
@KunjVaishnani-j7s 11 месяцев назад
it worked
@MonsterlessonsAcademy
@MonsterlessonsAcademy 11 месяцев назад
As expected!
@fl1pp1x
@fl1pp1x 2 года назад
I have an issue - when i run "npx lint-staged" i have only one tasks call but if i do the same with pre-commit hook which calles the same "npx lint-staged" i have too many callings of tasks (50+), wdyt about this issue?, i cant imagine what is going wrong...
@fl1pp1x
@fl1pp1x 2 года назад
"lint-staged": { "src/**/*.{js,jsx,ts,tsx,json,css,md,yml,yaml}": [ "prettier --write" ], "src/**/*.{js,jsx,ts,tsx}": [ "eslint --max-warnings=0" ] },
@fl1pp1x
@fl1pp1x 2 года назад
#!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" npx lint-staged
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
I'm sorry I never had such issue.
@mdalishanali476
@mdalishanali476 Год назад
thanks bro
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Welcome
@nikhilev3840
@nikhilev3840 6 месяцев назад
Do we need them in dependency? I think we can install them as devDependancy right? The official documentation says so.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 6 месяцев назад
dev dependency is better
@techakayy
@techakayy Год назад
Nice one mate! So, am I right it understanding that the pre-commit is primarily for fail-on-linting attempt (eslint) & not for formatting? Because any formatting write by prettier when git commit would be unstaged.
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Prettier is fine as well as a check but not as an autoformat as it will make files unstaged.
@techakayy
@techakayy Год назад
@@MonsterlessonsAcademy Thank you!
@Nickdaplayer
@Nickdaplayer Год назад
Hi, nice tutorial! Do I push the .husky-folder to the repository to ensure that other developers can use pre-commit hooks automatically? Or what is the best practice for that?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
If you want the same behaivour for everybody then yes you push it.
@g-luu
@g-luu 2 года назад
Nice tutorial would have been nice if it was angular specific.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
My next video will be exactly about Typescript and Eslint
@g-luu
@g-luu 2 года назад
@Miguel A Thanks will check it out.
@booi_mangang
@booi_mangang Год назад
do you still need these setups when the code automatically formatt and prettify itself when ctrl + s??
@MonsterlessonsAcademy
@MonsterlessonsAcademy Год назад
Yes sure. You ctrl + s just calls prettier
@booi_mangang
@booi_mangang Год назад
@@MonsterlessonsAcademy So, I don’t need to set all these up, right?
@jeffnikelson5824
@jeffnikelson5824 2 года назад
jetbrains IDEs have that in pre commit settings integrated already, don't they?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
Maybe but the idea is to install pre commit hooks automatically on the machine of every developer and not be dependent on IDE.
@jeffnikelson5824
@jeffnikelson5824 2 года назад
@@MonsterlessonsAcademy Oh yes right, now i get your point!
@MominKhan-sm3gh
@MominKhan-sm3gh 10 месяцев назад
Hey! Can you help me with the error given below when I run npx lint-staged. Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root at findPagesDir (C:\Users\momin.hayat\Desktop\ops-2-next ode_modules ext\dist\lib\find-pages-dir.js:42:15) "lint-staged": { "src/**/*.{js,html,css}": "prettier --write", "src/**/*.{ts,tsx}": "next lint" } and my folder structure is following src/app/*
@MonsterlessonsAcademy
@MonsterlessonsAcademy 10 месяцев назад
Unfortunately I don't help with debugging custom code
@tuanvominh3219
@tuanvominh3219 2 года назад
Amazing video 😄😄
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 года назад
Thanks 😁
Далее
А вы играли в school boy runaway?
00:30
Просмотров 149 тыс.
Новый конфиг для Eslint 9
18:59
Просмотров 10 тыс.
Automate Prettier, ESLint using Husky and Lint-Staged
17:43
I Do this for every commit and why you should too!
12:40
Lint & Format JavaScript with Biome
23:20
Просмотров 4,5 тыс.
From Good to Great: Optimizing Angular Performance
9:38
Introduction to Husky and Setup on Angular 16
18:29
Просмотров 1,1 тыс.