Compare commits
22 Commits
step-8
...
tjs/step-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d16442c1f4 | ||
|
|
00eade470c | ||
|
|
dbbb2064b7 | ||
|
|
28545516e3 | ||
|
|
b0d4378a07 | ||
|
|
e88f4ba7af | ||
|
|
650e66fe3f | ||
|
|
544df8b178 | ||
|
|
4fa1a97129 | ||
|
|
fbb81df6c9 | ||
|
|
fb1aa446f5 | ||
|
|
b6add202df | ||
|
|
544746d064 | ||
|
|
d0c1fa44e4 | ||
|
|
cd5939daf8 | ||
|
|
cc722afcb2 | ||
|
|
571fc946b8 | ||
|
|
898876d0d2 | ||
|
|
9c51bd92fa | ||
|
|
f10cfb98ce | ||
|
|
860492ad3f | ||
|
|
4e579627b7 |
13
.babelrc
Normal file
13
.babelrc
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"node": "10"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@babel/preset-typescript"
|
||||||
|
]
|
||||||
|
}
|
||||||
26
.eslintrc
26
.eslintrc
@@ -1,13 +1,31 @@
|
|||||||
{
|
{
|
||||||
"parser": "babel-eslint",
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": "2018"
|
"ecmaVersion": 2019,
|
||||||
|
"sourceType": "module",
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"no-console": "off"
|
"strict": ["error", "never"]
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true
|
||||||
}
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "**/*.+(ts|tsx)",
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "./tsconfig.json"
|
||||||
|
},
|
||||||
|
"plugins": ["@typescript-eslint/eslint-plugin"],
|
||||||
|
"extends": [
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"eslint-config-prettier/@typescript-eslint"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
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
|
node_modules
|
||||||
|
dist
|
||||||
|
|||||||
5
.huskyrc
Normal file
5
.huskyrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "npm run check-types && lint-staged"
|
||||||
|
}
|
||||||
|
}
|
||||||
9
.lintstagedrc
Normal file
9
.lintstagedrc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"*.+(js|ts|tsx)": [
|
||||||
|
"eslint"
|
||||||
|
],
|
||||||
|
"*.+(js|json|ts|tsx)": [
|
||||||
|
"prettier --write",
|
||||||
|
"git add"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
node_modules
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
build
|
|
||||||
.build
|
|
||||||
|
|
||||||
# etc...
|
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
{
|
{
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid",
|
||||||
"bracketSpacing": false,
|
"bracketSpacing": false,
|
||||||
|
"htmlWhitespaceSensitivity": "css",
|
||||||
|
"insertPragma": false,
|
||||||
"jsxBracketSameLine": false,
|
"jsxBracketSameLine": false,
|
||||||
|
"jsxSingleQuote": false,
|
||||||
"printWidth": 80,
|
"printWidth": 80,
|
||||||
"proseWrap": "always",
|
"proseWrap": "always",
|
||||||
|
"quoteProps": "as-needed",
|
||||||
|
"requirePragma": false,
|
||||||
"semi": false,
|
"semi": false,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
|
|||||||
5329
package-lock.json
generated
5329
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@@ -1,25 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "static-testing-tools",
|
"name": "static-testing-tools",
|
||||||
"version": "1.0.0",
|
"private": true,
|
||||||
"description": "",
|
"author": "Kent C. Dodds (http://kentcdodds.com/)",
|
||||||
"main": "index.js",
|
"license": "GPLv3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint src",
|
"build": "babel src --extensions .js,.ts,.tsx --out-dir dist",
|
||||||
"flow": "flow",
|
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
|
||||||
|
"check-types": "tsc",
|
||||||
|
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json|ts|tsx)\"",
|
||||||
"format": "npm run prettier -- --write",
|
"format": "npm run prettier -- --write",
|
||||||
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
|
"check-format": "npm run prettier -- --list-different",
|
||||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
|
"validate": "npm-run-all --parallel check-types check-format lint build"
|
||||||
"precommit": "npm run validate"
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
|
||||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
|
||||||
"license": "MIT",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^9.0.0",
|
"@babel/cli": "^7.7.0",
|
||||||
"eslint": "^5.5.0",
|
"@babel/core": "^7.7.2",
|
||||||
"eslint-config-prettier": "^3.0.1",
|
"@babel/preset-env": "^7.7.1",
|
||||||
"flow-bin": "^0.81.0",
|
"@babel/preset-typescript": "^7.7.2",
|
||||||
"husky": "^0.14.3",
|
"@typescript-eslint/eslint-plugin": "^2.7.0",
|
||||||
"prettier": "^1.14.2"
|
"@typescript-eslint/parser": "^2.7.0",
|
||||||
|
"eslint": "^6.6.0",
|
||||||
|
"eslint-config-prettier": "^6.5.0",
|
||||||
|
"husky": "^3.0.9",
|
||||||
|
"lint-staged": "^9.4.2",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^1.19.1",
|
||||||
|
"typescript": "^3.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const name = 'Freddy'
|
const username = 'freddy'
|
||||||
typeof name === 'string'
|
typeof username === 'string'
|
||||||
|
|
||||||
if (!('serviceWorker' in navigator)) {
|
if (!('serviceWorker' in navigator)) {
|
||||||
// you have an old browser :-(
|
// you have an old browser :-(
|
||||||
@@ -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,14 +1,13 @@
|
|||||||
// @flow
|
|
||||||
function add(a: number, b: number): number {
|
function add(a: number, b: number): number {
|
||||||
return a + b
|
return a + b
|
||||||
}
|
}
|
||||||
|
|
||||||
type User = {
|
interface User {
|
||||||
name: {
|
name: {
|
||||||
first: string,
|
first: string
|
||||||
middle: string,
|
middle: string
|
||||||
last: string,
|
last: string
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
function getFullName(user: User): string {
|
function getFullName(user: User): string {
|
||||||
const {
|
const {
|
||||||
6
tsconfig.json
Normal file
6
tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"baseUrl": "./src"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user