Compare commits
12 Commits
tjs/step-0
...
tjs/step-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
281993d1ca | ||
|
|
a1e30ee995 | ||
|
|
cc6fdf9d84 | ||
|
|
a5d2d971dd | ||
|
|
b41c948eeb | ||
|
|
a8d752b04f | ||
|
|
dda36098bd | ||
|
|
945eaac136 | ||
|
|
df642497e9 | ||
|
|
8fb12ded93 | ||
|
|
acf0e58463 | ||
|
|
c204cda937 |
12
.babelrc
Normal file
12
.babelrc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"node": "10"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
{
|
{
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2019
|
"ecmaVersion": 2019,
|
||||||
|
"sourceType": "module",
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
|
"project": "./tsconfig.json"
|
||||||
},
|
},
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint/eslint-plugin"],
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
@@ -12,7 +17,7 @@
|
|||||||
"eslint-config-prettier/@typescript-eslint"
|
"eslint-config-prettier/@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-console": "off"
|
"strict": ["error", "never"]
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true
|
||||||
1
00-start/.gitignore → .gitignore
vendored
1
00-start/.gitignore → .gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
dist
|
||||||
5
.huskyrc
Normal file
5
.huskyrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "npm run check-types && lint-staged"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,4 +6,4 @@
|
|||||||
"prettier --write",
|
"prettier --write",
|
||||||
"git add"
|
"git add"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3"
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const username = 'Freddy'
|
|
||||||
typeof username === 'strng'
|
|
||||||
|
|
||||||
if (!'serviceWorker' in navigator) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log('${greting} world!')
|
|
||||||
|
|
||||||
[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint src"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^6.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": "2018"
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"format": "prettier --write \"**/*.+(js|json|ts|tsx|md)\""
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"prettier": "^1.18.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!("serviceWorker" in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = "hello";
|
|
||||||
console.log(`${greeting} world!`);
|
|
||||||
|
|
||||||
[(1, 2, 3)].forEach(x => console.log(x));
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
03-configure-prettier/.gitignore
vendored
1
03-configure-prettier/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"format": "prettier --write \"**/*.+(js|json)\""
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"prettier": "^1.18.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"htmlWhitespaceSensitivity": "css",
|
|
||||||
"insertPragma": false,
|
|
||||||
"jsxBracketSameLine": false,
|
|
||||||
"jsxSingleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"proseWrap": "always",
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"requirePragma": false,
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"useTabs": false
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"format": "prettier --write \"**/*.+(js|json)\""
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"eslint-config-prettier": "^6.0.0",
|
|
||||||
"prettier": "^1.18.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"htmlWhitespaceSensitivity": "css",
|
|
||||||
"insertPragma": false,
|
|
||||||
"jsxBracketSameLine": false,
|
|
||||||
"jsxSingleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"proseWrap": "always",
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"requirePragma": false,
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"useTabs": false
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"format": "npm run prettier -- --write",
|
|
||||||
"prettier": "prettier \"**/*.+(js|json)\"",
|
|
||||||
"validate": "npm run lint && npm run prettier -- --list-different"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"eslint-config-prettier": "^6.0.0",
|
|
||||||
"prettier": "^1.18.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"htmlWhitespaceSensitivity": "css",
|
|
||||||
"insertPragma": false,
|
|
||||||
"jsxBracketSameLine": false,
|
|
||||||
"jsxSingleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"proseWrap": "always",
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"requirePragma": false,
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"useTabs": false
|
|
||||||
}
|
|
||||||
1103
06-install-run-and-configure-typescript/package-lock.json
generated
1103
06-install-run-and-configure-typescript/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint --ext .js,.ts,.tsx .",
|
|
||||||
"check-types": "tsc",
|
|
||||||
"format": "npm run prettier -- --write",
|
|
||||||
"prettier": "prettier \"**/*.+(js|json|ts)\"",
|
|
||||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run check-types"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@typescript-eslint/eslint-plugin": "^1.13.0",
|
|
||||||
"@typescript-eslint/parser": "^1.13.0",
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"eslint-config-prettier": "^6.0.0",
|
|
||||||
"prettier": "^1.18.2",
|
|
||||||
"typescript": "^3.5.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"parser": "babel-eslint",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"htmlWhitespaceSensitivity": "css",
|
|
||||||
"insertPragma": false,
|
|
||||||
"jsxBracketSameLine": false,
|
|
||||||
"jsxSingleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"proseWrap": "always",
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"requirePragma": false,
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"useTabs": false
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"check-types": "tsc",
|
|
||||||
"format": "npm run prettier -- --write",
|
|
||||||
"prettier": "prettier \"**/*.+(js|json|ts)\"",
|
|
||||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run check-types"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-eslint": "11.0.0-beta.0",
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"eslint-config-prettier": "^6.0.0",
|
|
||||||
"husky": "^3.0.2",
|
|
||||||
"prettier": "^1.18.2",
|
|
||||||
"typescript": "^3.5.3"
|
|
||||||
},
|
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "npm run validate"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
function add(a: number, b: number): number {
|
|
||||||
return a + b
|
|
||||||
}
|
|
||||||
|
|
||||||
interface User {
|
|
||||||
name: {
|
|
||||||
first: string
|
|
||||||
middle: string
|
|
||||||
last: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getFullName(user: User): string {
|
|
||||||
const {
|
|
||||||
name: {first, middle, last},
|
|
||||||
} = user
|
|
||||||
return [first, middle, last].filter(Boolean).join('')
|
|
||||||
}
|
|
||||||
|
|
||||||
add(1, 2)
|
|
||||||
|
|
||||||
getFullName({name: {first: 'Joe', middle: 'Bud', last: 'Matthews'}})
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
// because we're compiling with Babel instead of TypeScript
|
|
||||||
// and we're only using TypeScript for type checking, we'll set "noEmit"
|
|
||||||
// to true so running type checking doesn't generate any files.
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"include": ["src"]
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"parser": "babel-eslint",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2019
|
|
||||||
},
|
|
||||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node_modules
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"arrowParens": "avoid",
|
|
||||||
"bracketSpacing": false,
|
|
||||||
"htmlWhitespaceSensitivity": "css",
|
|
||||||
"insertPragma": false,
|
|
||||||
"jsxBracketSameLine": false,
|
|
||||||
"jsxSingleQuote": false,
|
|
||||||
"printWidth": 80,
|
|
||||||
"proseWrap": "always",
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"requirePragma": false,
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": true,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"useTabs": false
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "static-testing-tools",
|
|
||||||
"private": true,
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "GPLv3",
|
|
||||||
"scripts": {
|
|
||||||
"lint": "eslint .",
|
|
||||||
"check-types": "tsc",
|
|
||||||
"format": "npm run prettier -- --write",
|
|
||||||
"prettier": "prettier \"**/*.+(js|json|ts)\"",
|
|
||||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run check-types"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-eslint": "^10.0.2",
|
|
||||||
"eslint": "^6.1.0",
|
|
||||||
"eslint-config-prettier": "^6.0.0",
|
|
||||||
"husky": "^3.0.2",
|
|
||||||
"lint-staged": "^9.2.1",
|
|
||||||
"prettier": "^1.18.2",
|
|
||||||
"typescript": "^3.5.3"
|
|
||||||
},
|
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "lint-staged && npm run check-types"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const username = 'freddy'
|
|
||||||
typeof username === 'string'
|
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
|
||||||
// you have an old browser :-(
|
|
||||||
}
|
|
||||||
|
|
||||||
const greeting = 'hello'
|
|
||||||
console.log(`${greeting} world!`)
|
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
function add(a: number, b: number): number {
|
|
||||||
return a + b
|
|
||||||
}
|
|
||||||
|
|
||||||
interface User {
|
|
||||||
name: {
|
|
||||||
first: string
|
|
||||||
middle: string
|
|
||||||
last: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getFullName(user: User): string {
|
|
||||||
const {
|
|
||||||
name: {first, middle, last},
|
|
||||||
} = user
|
|
||||||
return [first, middle, last].filter(Boolean).join('')
|
|
||||||
}
|
|
||||||
|
|
||||||
add(1, 2)
|
|
||||||
|
|
||||||
getFullName({name: {first: 'Joe', middle: 'Bud', last: 'Matthews'}})
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
// because we're compiling with Babel instead of TypeScript
|
|
||||||
// and we're only using TypeScript for type checking, we'll set "noEmit"
|
|
||||||
// to true so running type checking doesn't generate any files.
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"include": ["src"]
|
|
||||||
}
|
|
||||||
5670
package-lock.json
generated
Normal file
5670
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
29
package.json
Normal file
29
package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "static-testing-tools",
|
||||||
|
"private": true,
|
||||||
|
"author": "Kent C. Dodds (http://kentcdodds.com/)",
|
||||||
|
"license": "GPLv3",
|
||||||
|
"scripts": {
|
||||||
|
"build": "babel src --out-dir dist",
|
||||||
|
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
|
||||||
|
"check-types": "tsc",
|
||||||
|
"prettier": "prettier --ignore-path .gitignore --write \"**/*.+(js|json)\"",
|
||||||
|
"format": "npm run prettier -- --write",
|
||||||
|
"check-format": "npm run prettier -- --list-different",
|
||||||
|
"validate": "npm-run-all --parallel check-types check-format lint build"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/cli": "^7.5.5",
|
||||||
|
"@babel/core": "^7.5.5",
|
||||||
|
"@babel/preset-env": "^7.5.5",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^2.0.0",
|
||||||
|
"@typescript-eslint/parser": "^2.0.0",
|
||||||
|
"eslint": "^6.1.0",
|
||||||
|
"eslint-config-prettier": "^6.0.0",
|
||||||
|
"husky": "^3.0.2",
|
||||||
|
"lint-staged": "^9.2.1",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^1.18.2",
|
||||||
|
"typescript": "^3.5.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,4 +7,4 @@ if (!('serviceWorker' in navigator)) {
|
|||||||
|
|
||||||
const greeting = 'hello'
|
const greeting = 'hello'
|
||||||
console.log(`${greeting} world!`)
|
console.log(`${greeting} world!`)
|
||||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
;[1, 2, 3].forEach(x => console.log(x))
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
// because we're compiling with Babel instead of TypeScript
|
// because we're compiling with Babel instead of TypeScript
|
||||||
// and we're only using TypeScript for type checking, we'll set "noEmit"
|
// and we're only using TypeScript for type checking, we'll set "noEmit"
|
||||||
// to true so running type checking doesn't generate any files.
|
// to true so running type checking doesn't generate any files.
|
||||||
"noEmit": true
|
"noEmit": true,
|
||||||
},
|
"baseUrl": "./src"
|
||||||
"include": ["src"]
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user