3 Commits

Author SHA1 Message Date
Kent C. Dodds
fbb81df6c9 install and run prettier 2019-11-12 17:32:53 -07:00
Kent C. Dodds
fb1aa446f5 scripting eslint 2019-11-12 17:30:23 -07:00
Kent C. Dodds
b6add202df eslint extends 2019-11-12 17:22:47 -07:00
4 changed files with 19 additions and 16 deletions

View File

@@ -6,13 +6,9 @@
"jsx": true
}
},
"extends": ["eslint:recommended"],
"rules": {
"strict": ["error", "never"],
"valid-typeof": "error",
"no-unsafe-negation": "error",
"no-unused-vars": "error",
"no-unexpected-multiline": "error",
"no-undef": "error"
"strict": ["error", "never"]
},
"env": {
"browser": true

6
package-lock.json generated
View File

@@ -3178,6 +3178,12 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"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": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",

View File

@@ -4,12 +4,15 @@
"author": "Kent C. Dodds (http://kentcdodds.com/)",
"license": "GPLv3",
"scripts": {
"build": "babel src --out-dir dist"
"build": "babel src --out-dir dist",
"lint": "eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|json)\""
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"eslint": "^6.6.0"
"eslint": "^6.6.0",
"prettier": "^1.19.1"
}
}

View File

@@ -1,12 +1,10 @@
'use strict'
const username = "freddy";
typeof username === "string";
const username = 'freddy'
typeof username === 'strng'
if (!'serviceWorker' in navigator) {
if (!("serviceWorker" in navigator)) {
// you have an old browser :-(
}
const greeting = 'hello'
console.log('${greeting} world!')
[1, 2, 3].forEach(x => console.log(x))
const greeting = "hello";
console.log(`${greeting} world!`);
[1, 2, 3].forEach(x => console.log(x));