Compare commits
19 Commits
step-9
...
tjs/step-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
281993d1ca | ||
|
|
a1e30ee995 | ||
|
|
cc6fdf9d84 | ||
|
|
a5d2d971dd | ||
|
|
b41c948eeb | ||
|
|
a8d752b04f | ||
|
|
dda36098bd | ||
|
|
945eaac136 | ||
|
|
df642497e9 | ||
|
|
8fb12ded93 | ||
|
|
acf0e58463 | ||
|
|
c204cda937 | ||
|
|
cd5939daf8 | ||
|
|
cc722afcb2 | ||
|
|
571fc946b8 | ||
|
|
898876d0d2 | ||
|
|
9c51bd92fa | ||
|
|
f10cfb98ce | ||
|
|
860492ad3f |
12
.babelrc
Normal file
12
.babelrc
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "10"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
20
.eslintrc
20
.eslintrc
@@ -1,11 +1,23 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "2018"
|
||||
"ecmaVersion": 2019,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": ["@typescript-eslint/eslint-plugin"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"eslint-config-prettier",
|
||||
"eslint-config-prettier/@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
"strict": ["error", "never"]
|
||||
},
|
||||
"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
|
||||
|
||||
5
.huskyrc
Normal file
5
.huskyrc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"hooks": {
|
||||
"pre-commit": "npm run check-types && lint-staged"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
{
|
||||
"linters": {
|
||||
"*.js": [
|
||||
"eslint"
|
||||
],
|
||||
"*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)": [
|
||||
"*.+(js|json|ts)": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
node_modules
|
||||
coverage
|
||||
dist
|
||||
build
|
||||
.build
|
||||
|
||||
# etc...
|
||||
@@ -1,9 +1,14 @@
|
||||
{
|
||||
"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,
|
||||
|
||||
4436
package-lock.json
generated
4436
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@@ -1,26 +1,29 @@
|
||||
{
|
||||
"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",
|
||||
"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",
|
||||
"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": "lint-staged && npm run flow"
|
||||
"check-format": "npm run prettier -- --list-different",
|
||||
"validate": "npm-run-all --parallel check-types check-format lint build"
|
||||
},
|
||||
"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",
|
||||
"lint-staged": "^7.2.2",
|
||||
"prettier": "^1.14.2"
|
||||
"@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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const name = 'Freddy'
|
||||
typeof name === 'string'
|
||||
const username = 'freddy'
|
||||
typeof username === 'string'
|
||||
|
||||
if (!('serviceWorker' in navigator)) {
|
||||
// you have an old browser :-(
|
||||
@@ -7,4 +7,4 @@ if (!('serviceWorker' in navigator)) {
|
||||
|
||||
const greeting = 'hello'
|
||||
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 {
|
||||
return a + b
|
||||
}
|
||||
|
||||
type User = {
|
||||
interface User {
|
||||
name: {
|
||||
first: string,
|
||||
middle: string,
|
||||
last: string,
|
||||
},
|
||||
first: string
|
||||
middle: string
|
||||
last: string
|
||||
}
|
||||
}
|
||||
function getFullName(user: User): string {
|
||||
const {
|
||||
9
tsconfig.json
Normal file
9
tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
// 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,
|
||||
"baseUrl": "./src"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user