Skip to content

Instantly share code, notes, and snippets.

View viT-1's full-sized avatar

Vitaly Pinchuk viT-1

View GitHub Profile
@viT-1
viT-1 / rest-soap-api.md
Created January 24, 2022 09:52
#gist-bookmark #rest #soap #http #architecture
@viT-1
viT-1 / esm-alias-resolve.md
Last active January 21, 2022 13:24
#gist-bookmark #js #esm #importmap #import #alias

Если не использовать TypeScript, который при tsc-трансформации в js пропишет нужные пути в import при помощи transform и карты путей/alias, то в браузерах в importmap следует указывать путь не только для сторонних библиотек, но и под каждый импортируемый через alias файл! Спецификация importmap не предполагает glob-масок.

При этом eslint, jest и webpack конфигурируются по-своему, получаем дублирование кода. Нужда в конвертерах [eslint-typescript](http

@viT-1
viT-1 / http-2-and-optimization.md
Created December 24, 2021 07:26
#gist-bookmark #http #css #server
@viT-1
viT-1 / airbnb-func-names.md
Last active January 13, 2022 11:03
#gist-bookmark #eslint #js #airbnb #prototype

With AirBnB this code is bad:

Greeter.prototype.greet = function () {
	return `${greetText}, ${this.greetTarget}`;
};

This article helps me to fix code:

Greeter.prototype.greet = function greet() {
@viT-1
viT-1 / no-default-export.md
Last active January 13, 2022 10:50
#gist-bookmark #eslint #js #esm #export #airbnb

Prefer (or require) named exports from all modules, regardless of how many exports they have! By Thomas Randolph 2019.09.05

Before airbnb-base we can use only one rule: "import/no-default-export": "error" but after airbnb (which want to use default exports) you must to add second rule: "import/prefer-default-export": "off"

Why I've stopped exporting defaults from my JavaScript modules by Nicholas C. Zakas 2019.01.15

@viT-1
viT-1 / js-better-to-stop-using-classes.md
Last active January 13, 2022 09:35
#gist-bookmark #js #es6 #es5 #class #oop #prototype #styleguide #decorator #computed #getter-setter
@viT-1
viT-1 / makeev-opera.md
Created December 24, 2021 12:24
#gist-bookmark #opera
@viT-1
viT-1 / eslint-global-rc.md
Last active December 20, 2021 10:25
#gist-bookmark #eslint #js

eslint since v7 warns about deprecation of root config Now, if you have eslint config in your project and global config, you should define it as root config (loss or copy/paste all recommended rules - preferred way with saving rules relate to project) or define extends key with file system dotted path! 🤦‍♂️

If you want to have shared rules for different projects and don't want hardcoding path to file with common rules, you should create your custom eslint plugin with your rules (may be based on other recommended rules).

@viT-1
viT-1 / github-master-to-main-branch.md
Created December 17, 2021 12:50
#gist-bookmark #git #github #tolerance