2 Commits

Author SHA1 Message Date
Kent C. Dodds
94216f47e8 setup eslint-config-prettier 2018-09-14 21:49:45 -06:00
Kent C. Dodds
4f2fde56e2 config prettier 2018-09-14 21:49:32 -06:00
6 changed files with 42 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
"parserOptions": { "parserOptions": {
"ecmaVersion": "2018" "ecmaVersion": "2018"
}, },
"extends": ["eslint:recommended"], "extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": { "rules": {
"no-console": "off" "no-console": "off"
}, },

7
.prettierignore Normal file
View File

@@ -0,0 +1,7 @@
node_modules
coverage
dist
build
.build
# etc...

12
.prettierrc Normal file
View File

@@ -0,0 +1,12 @@
{
"arrowParens": "avoid",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"printWidth": 80,
"proseWrap": "always",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}

15
package-lock.json generated
View File

@@ -302,6 +302,15 @@
"text-table": "^0.2.0" "text-table": "^0.2.0"
} }
}, },
"eslint-config-prettier": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.0.1.tgz",
"integrity": "sha512-vA0TB8HCx/idHXfKHYcg9J98p0Q8nkfNwNAoP7e+ywUidn6ScaFS5iqncZAHPz+/a0A/tp657ulFHFx/2JDP4Q==",
"dev": true,
"requires": {
"get-stdin": "^6.0.0"
}
},
"eslint-scope": { "eslint-scope": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
@@ -442,6 +451,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
},
"glob": { "glob": {
"version": "7.1.3", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",

View File

@@ -12,6 +12,7 @@
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"eslint": "^5.5.0", "eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"prettier": "^1.14.2" "prettier": "^1.14.2"
} }
} }

View File

@@ -1,11 +1,11 @@
const name = "Freddy"; const name = 'Freddy'
typeof name === "string"; typeof name === '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))