2 Commits

Author SHA1 Message Date
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
3 changed files with 8 additions and 13 deletions

View File

@@ -6,13 +6,9 @@
"jsx": true "jsx": true
} }
}, },
"extends": ["eslint:recommended"],
"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

View File

@@ -4,7 +4,8 @@
"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 ."
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.7.0", "@babel/cli": "^7.7.0",

View File

@@ -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))