Compare commits
10 Commits
step-8
...
tjs/step-0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
544746d064 | ||
|
|
d0c1fa44e4 | ||
|
|
cd5939daf8 | ||
|
|
cc722afcb2 | ||
|
|
571fc946b8 | ||
|
|
898876d0d2 | ||
|
|
9c51bd92fa | ||
|
|
f10cfb98ce | ||
|
|
860492ad3f | ||
|
|
4e579627b7 |
12
.babelrc
Normal file
12
.babelrc
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "10"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
15
.eslintrc
15
.eslintrc
@@ -1,11 +1,18 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "2018"
|
||||
"ecmaVersion": 2019,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
"strict": ["error", "never"],
|
||||
"valid-typeof": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-undef": "error"
|
||||
},
|
||||
"env": {
|
||||
"browser": true
|
||||
|
||||
11
.flowconfig
11
.flowconfig
@@ -1,11 +0,0 @@
|
||||
[ignore]
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
|
||||
[strict]
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
node_modules
|
||||
dist
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
node_modules
|
||||
coverage
|
||||
dist
|
||||
build
|
||||
.build
|
||||
|
||||
# etc...
|
||||
12
.prettierrc
12
.prettierrc
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"bracketSpacing": false,
|
||||
"jsxBracketSameLine": false,
|
||||
"printWidth": 80,
|
||||
"proseWrap": "always",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"useTabs": false
|
||||
}
|
||||
3730
package-lock.json
generated
3730
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@@ -1,25 +1,15 @@
|
||||
{
|
||||
"name": "static-testing-tools",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"author": "Kent C. Dodds (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"flow": "flow",
|
||||
"format": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
|
||||
"precommit": "npm run validate"
|
||||
"build": "babel src --out-dir dist"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^9.0.0",
|
||||
"eslint": "^5.5.0",
|
||||
"eslint-config-prettier": "^3.0.1",
|
||||
"flow-bin": "^0.81.0",
|
||||
"husky": "^0.14.3",
|
||||
"prettier": "^1.14.2"
|
||||
"@babel/cli": "^7.7.0",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/preset-env": "^7.7.1",
|
||||
"eslint": "^6.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
const name = 'Freddy'
|
||||
typeof name === 'string'
|
||||
'use strict'
|
||||
|
||||
if (!('serviceWorker' in navigator)) {
|
||||
const username = 'freddy'
|
||||
typeof username === 'strng'
|
||||
|
||||
if (!'serviceWorker' in navigator) {
|
||||
// you have an old browser :-(
|
||||
}
|
||||
|
||||
const greeting = 'hello'
|
||||
console.log(`${greeting} world!`)
|
||||
;[(1, 2, 3)].forEach(x => console.log(x))
|
||||
console.log('${greeting} world!')
|
||||
[1, 2, 3].forEach(x => console.log(x))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// @flow
|
||||
function add(a: number, b: number): number {
|
||||
return a + b
|
||||
}
|
||||
|
||||
type 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'}})
|
||||
Reference in New Issue
Block a user