Compare commits
7 Commits
tjs/step-0
...
tjs/step-0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e88f4ba7af | ||
|
|
650e66fe3f | ||
|
|
544df8b178 | ||
|
|
4fa1a97129 | ||
|
|
fbb81df6c9 | ||
|
|
fb1aa446f5 | ||
|
|
b6add202df |
@@ -6,13 +6,9 @@
|
|||||||
"jsx": true
|
"jsx": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"extends": ["eslint:recommended", "eslint-config-prettier"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"strict": ["error", "never"],
|
"strict": ["error", "never"]
|
||||||
"valid-typeof": "error",
|
|
||||||
"no-unsafe-negation": "error",
|
|
||||||
"no-unused-vars": "error",
|
|
||||||
"no-unexpected-multiline": "error",
|
|
||||||
"no-undef": "error"
|
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true
|
"browser": true
|
||||||
|
|||||||
17
.prettierrc
Normal file
17
.prettierrc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
21
package-lock.json
generated
21
package-lock.json
generated
@@ -1503,6 +1503,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"eslint-config-prettier": {
|
||||||
|
"version": "6.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.5.0.tgz",
|
||||||
|
"integrity": "sha512-cjXp8SbO9VFGW/Z7mbTydqS9to8Z58E5aYhj3e1+Hx7lS9s6gL5ILKNpCqZAFOVYRcSkWPFYljHrEh8QFEK5EQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"get-stdin": "^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"eslint-scope": {
|
"eslint-scope": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
|
||||||
@@ -2385,6 +2394,12 @@
|
|||||||
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
|
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"get-stdin": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"get-value": {
|
"get-value": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
|
||||||
@@ -3178,6 +3193,12 @@
|
|||||||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
|
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"prettier": {
|
||||||
|
"version": "1.19.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz",
|
||||||
|
"integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"private": {
|
"private": {
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -4,12 +4,19 @@
|
|||||||
"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 .",
|
||||||
|
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json)\"",
|
||||||
|
"format": "npm run prettier -- --write",
|
||||||
|
"check-format": "npm run prettier -- --list-different",
|
||||||
|
"validate": "npm run check-format && npm run lint && npm run build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.7.0",
|
"@babel/cli": "^7.7.0",
|
||||||
"@babel/core": "^7.7.2",
|
"@babel/core": "^7.7.2",
|
||||||
"@babel/preset-env": "^7.7.1",
|
"@babel/preset-env": "^7.7.1",
|
||||||
"eslint": "^6.6.0"
|
"eslint": "^6.6.0",
|
||||||
|
"eslint-config-prettier": "^6.5.0",
|
||||||
|
"prettier": "^1.19.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
'use strict'
|
|
||||||
|
|
||||||
const username = 'freddy'
|
const username = 'freddy'
|
||||||
typeof username === 'strng'
|
typeof username === 'string'
|
||||||
|
|
||||||
if (!'serviceWorker' in navigator) {
|
if (!('serviceWorker' in navigator)) {
|
||||||
// you have an old browser :-(
|
// you have an old browser :-(
|
||||||
}
|
}
|
||||||
|
|
||||||
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))
|
||||||
|
|||||||
14
src/typescript-example.js
Normal file
14
src/typescript-example.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
function add(a, b) {
|
||||||
|
return a + b
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFullName(user) {
|
||||||
|
const {
|
||||||
|
name: {first, middle, last},
|
||||||
|
} = user
|
||||||
|
return [first, middle, last].filter(Boolean).join('')
|
||||||
|
}
|
||||||
|
|
||||||
|
add(1, 'two')
|
||||||
|
|
||||||
|
getFullName({name: {first: 'Joe', midd1e: 'Bud', last: 'Matthews'}})
|
||||||
Reference in New Issue
Block a user