some progress made
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write \"**/*.+(js|json|ts|tsx|md)\""
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write \"**/*.+(js|json|ts|tsx|md)\""
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write \"**/*.+(js|json|ts|tsx|md)\""
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"lint": "eslint .",
|
||||
"format": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.+(js|json|ts|tsx|md)\"",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019
|
||||
},
|
||||
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
},
|
||||
"env": {
|
||||
"browser": true
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
[ignore]
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
|
||||
[strict]
|
||||
20
06-install-run-and-configure-typescript/.eslintrc
Normal file
20
06-install-run-and-configure-typescript/.eslintrc
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019
|
||||
},
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"eslint-config-prettier",
|
||||
"eslint-config-prettier/@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
},
|
||||
"env": {
|
||||
"browser": true
|
||||
}
|
||||
}
|
||||
1103
06-install-run-and-configure-typescript/package-lock.json
generated
Normal file
1103
06-install-run-and-configure-typescript/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -4,17 +4,18 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"flow": "flow",
|
||||
"lint": "eslint --ext .js,.ts,.tsx .",
|
||||
"check-types": "tsc",
|
||||
"format": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.+(js|json|ts|tsx|md)\"",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow"
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && check-types"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^9.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^1.13.0",
|
||||
"@typescript-eslint/parser": "^1.13.0",
|
||||
"eslint": "^6.1.0",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"flow-bin": "^0.81.0",
|
||||
"prettier": "^1.18.2"
|
||||
"prettier": "^1.18.2",
|
||||
"typescript": "^3.5.3"
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
// @flow
|
||||
const username = 'freddy'
|
||||
typeof username === 'string'
|
||||
|
||||
function add(a: number, b: number): number {
|
||||
return a + b
|
||||
}
|
||||
|
||||
type User = {
|
||||
name: {
|
||||
first: string,
|
||||
middle: string,
|
||||
last: string,
|
||||
},
|
||||
first: string
|
||||
middle: string
|
||||
last: string
|
||||
}
|
||||
}
|
||||
function getFullName(user: User): string {
|
||||
const {
|
||||
11
06-install-run-and-configure-typescript/tsconfig.json
Normal file
11
06-install-run-and-configure-typescript/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"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,11 +0,0 @@
|
||||
[ignore]
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
|
||||
[strict]
|
||||
@@ -4,19 +4,19 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"flow": "flow",
|
||||
"lint": "eslint .",
|
||||
"check-types": "tsc",
|
||||
"format": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.+(js|json|ts|tsx|md)\"",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && check-types",
|
||||
"precommit": "npm run validate"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^9.0.0",
|
||||
"babel-eslint": "11.0.0-beta.0",
|
||||
"eslint": "^6.1.0",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"flow-bin": "^0.81.0",
|
||||
"husky": "^3.0.2",
|
||||
"prettier": "^1.18.2"
|
||||
"prettier": "^1.18.2",
|
||||
"typescript": "^3.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// @flow
|
||||
function add(a: number, b: number): number {
|
||||
return a + b
|
||||
}
|
||||
|
||||
type User = {
|
||||
name: {
|
||||
first: string,
|
||||
middle: string,
|
||||
last: string,
|
||||
},
|
||||
first: string
|
||||
middle: string
|
||||
last: string
|
||||
}
|
||||
}
|
||||
function getFullName(user: User): string {
|
||||
const {
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"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,11 +0,0 @@
|
||||
[ignore]
|
||||
|
||||
[include]
|
||||
|
||||
[libs]
|
||||
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
|
||||
[strict]
|
||||
@@ -4,24 +4,24 @@
|
||||
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
|
||||
"license": "GPLv3",
|
||||
"scripts": {
|
||||
"lint": "eslint src",
|
||||
"flow": "flow",
|
||||
"lint": "eslint .",
|
||||
"check-types": "tsc",
|
||||
"format": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.+(js|json|ts|tsx|md)\"",
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && npm run flow"
|
||||
"validate": "npm run lint && npm run prettier -- --list-different && check-types"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.2",
|
||||
"eslint": "^6.1.0",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"flow-bin": "^0.81.0",
|
||||
"husky": "^3.0.2",
|
||||
"lint-staged": "^9.2.1",
|
||||
"prettier": "^1.18.2"
|
||||
"prettier": "^1.18.2",
|
||||
"typescript": "^3.5.3"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged && npm run flow"
|
||||
"pre-commit": "lint-staged && check-types"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// @flow
|
||||
function add(a: number, b: number): number {
|
||||
return a + b
|
||||
}
|
||||
|
||||
type User = {
|
||||
name: {
|
||||
first: string,
|
||||
middle: string,
|
||||
last: string,
|
||||
},
|
||||
first: string
|
||||
middle: string
|
||||
last: string
|
||||
}
|
||||
}
|
||||
function getFullName(user: User): string {
|
||||
const {
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"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"]
|
||||
}
|
||||
Reference in New Issue
Block a user