This will give you complete intellisense and type safety within your app and CSS modules
🚨 NOTE
- refactoring className from ts file wont update your css/scss className, to change class names you have to change it within your
.module.scss
file
# origin: https://github.com/JSMonk/my-vimrc/blob/master/.vimrc | |
call plug#begin('~/.vim/plugged') | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'bling/vim-airline' | |
Plug 'othree/javascript-libraries-syntax.vim' | |
Plug 'pangloss/vim-javascript' | |
Plug 'isRuslan/vim-es6' | |
Plug 'mattn/emmet-vim' |
set t_RV= | |
set t_vb= | |
call plug#begin('~/.vim/plugged') | |
" Initialize plugin system | |
Plug 'easymotion/vim-easymotion' | |
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align | |
Plug 'junegunn/vim-easy-align' | |
" Any valid git URL is allowed |
[alias] | |
# tips from Harry Roberts | |
# https://csswizardry.com/2017/05/little-things-i-like-to-do-with-git/ | |
stats = !git shortlog -sn --all --no-merges | |
recent = !git for-each-ref --count=5 --sort=-committerdate refs/heads/ --format='%(refname:short)' | |
# tips from Rob Miller | |
# https://gist.github.com/robmiller/6018582 | |
br-name = "!git rev-parse --abbrev-ref HEAD" | |
diffmaster = "!git log --oneline origin/master..$(git br-name)" |
{ | |
"name": "example", | |
"version": "0.0.1", | |
"description": "examplio", | |
"main": "index.js", | |
"author": "Eugene Chulkov", | |
"license": "MIT", | |
"dependencies": {}, | |
"devDependencies": { | |
"husky": "^3.0.8", |
import React from 'react' | |
import axios, { post } from 'axios'; | |
class SimpleReactFileUpload extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state ={ | |
file:null | |
} |
const _isEmpty = require('lodash/isEmpty') | |
module.exports = (news, prevResults) => { | |
const recordsToSave = [] | |
if (_isEmpty(news) || _isEmpty(prevResults)) { | |
return recordsToSave | |
} | |
// some loop over values |
class PersistData { | |
storageName: string | |
constructor(storageName: string) { | |
this.storageName = storageName | |
} | |
get() { | |
try { | |
const value = window.localStorage.getItem(this.storageName) || '' |
// How to test something with Jest and process.env | |
// Details link to original author's response on SO | |
// https://stackoverflow.com/questions/48033841/test-process-env-with-jest | |
describe('environmental variables', () => { | |
const OLD_ENV = process.env; | |
beforeEach(() => { | |
// MOST IMPORTANT THING IS 👇 | |
jest.resetModules() // Most important - it clears the cache |
module.exports = { | |
'ar-AR': { | |
'nativeName': 'العربية', | |
'englishName': 'Arabic' | |
}, | |
'cs': { | |
'nativeName': 'Čeština', | |
'englishName': 'Czech' | |
}, | |
'uk': { |