Skip to content

Instantly share code, notes, and snippets.

View gearmobile's full-sized avatar
🇷🇺
Working remotely

Valery Semenenko gearmobile

🇷🇺
Working remotely
View GitHub Profile
@phatnguyenuit
phatnguyenuit / how-to-sort-imports-like-a-pro.md
Last active March 3, 2024 11:10
How to sort imports like a pro in TypeScript

How to sort imports like a pro in TypeScript

Crossing reviews becomes a very common activity today in engineering behavior. To help us review changes for pull/merge requests easier, sorting imports can help us a much. The codebase becomes more professional and more consistent, reviewers will be happier, and the review process will be faster, focusing on the implementation changes ONLY.

Have you ever thought about how to sort imports in TypeScript projects automatically?

Let me show you how to archive sorting imports automatically in TypeScript projects with ESLint!

@realmyst
realmyst / gist:1262561
Created October 4, 2011 19:34
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);