2 Commits

Author SHA1 Message Date
Kent C. Dodds
e88f4ba7af SETUP FOR TYPESCRIPT 2019-11-12 17:36:47 -07:00
Kent C. Dodds
650e66fe3f prettier --list-different 2019-11-12 17:36:05 -07:00
2 changed files with 18 additions and 1 deletions

View File

@@ -6,7 +6,10 @@
"scripts": {
"build": "babel src --out-dir dist",
"lint": "eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|json)\""
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json)\"",
"format": "npm run prettier -- --write",
"check-format": "npm run prettier -- --list-different",
"validate": "npm run check-format && npm run lint && npm run build"
},
"devDependencies": {
"@babel/cli": "^7.7.0",

14
src/typescript-example.js Normal file
View File

@@ -0,0 +1,14 @@
function add(a, b) {
return a + b
}
function getFullName(user) {
const {
name: {first, middle, last},
} = user
return [first, middle, last].filter(Boolean).join('')
}
add(1, 'two')
getFullName({name: {first: 'Joe', midd1e: 'Bud', last: 'Matthews'}})