Compare commits
3 Commits
tjs/step-1
...
tjs/step-0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6add202df | ||
|
|
544746d064 | ||
|
|
d0c1fa44e4 |
13
.eslintrc
13
.eslintrc
@@ -1,21 +1,12 @@
|
|||||||
{
|
{
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2019,
|
"ecmaVersion": 2019,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true
|
"jsx": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"project": "./tsconfig.json"
|
"extends": ["eslint:recommended"],
|
||||||
},
|
|
||||||
"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": {
|
"rules": {
|
||||||
"strict": ["error", "never"]
|
"strict": ["error", "never"]
|
||||||
},
|
},
|
||||||
|
|||||||
5
.huskyrc
5
.huskyrc
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "npm run check-types && lint-staged"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"*.js": [
|
|
||||||
"eslint"
|
|
||||||
],
|
|
||||||
"*.+(js|json|ts)": [
|
|
||||||
"prettier --write",
|
|
||||||
"git add"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
17
.prettierrc
17
.prettierrc
@@ -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
|
|
||||||
}
|
|
||||||
2625
package-lock.json
generated
2625
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@@ -4,26 +4,12 @@
|
|||||||
"author": "Kent C. Dodds (http://kentcdodds.com/)",
|
"author": "Kent C. Dodds (http://kentcdodds.com/)",
|
||||||
"license": "GPLv3",
|
"license": "GPLv3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "babel src --out-dir dist",
|
"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": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.5.5",
|
"@babel/cli": "^7.7.0",
|
||||||
"@babel/core": "^7.5.5",
|
"@babel/core": "^7.7.2",
|
||||||
"@babel/preset-env": "^7.5.5",
|
"@babel/preset-env": "^7.7.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.0.0",
|
"eslint": "^6.6.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,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,9 +0,0 @@
|
|||||||
{
|
|
||||||
"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