Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
mojaray2k / typescript-compiler-config-optons.md
Created May 23, 2020 16:17
Common TypeScript compiler and tsconfig options

TypeScript Compiler and TS Config Options

You can store the TS compiler configuration in the file called tsconfig.json. You’ll usually add this file to the root directory of your project, together with the package.json.

When you launch the compiler, it reads the tsconfig.json from the folder you launched it from, to get the instructions about how to compile your project (e.g., which source files to compile, where to store the output, etc).

The compiler reads the tsconfig.json from the folder where you run it. Also, you can tell the compiler where to look for the config using the -p option:

tsc -p tsconfig.server.json The structure of the tsconfig.json looks like this:

@rstacruz
rstacruz / README.md
Last active January 2, 2026 06:19
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

@donaldpipowitch
donaldpipowitch / example.tsx
Created November 6, 2019 07:43
Mock Upload Progress with axios-mock-adapter
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
const mock = new MockAdapter(axios);
// this mocks a request which is always at 40% progress
mock.onPost('/upload-1').reply((config) => {
const total = 1024; // mocked file size
const progress = 0.4;
if (config.onUploadProgress) {
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 5, 2026 08:44
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example