3 Commits

Author SHA1 Message Date
Kent C. Dodds
437ed30ddb list different 2018-09-14 22:01:31 -06:00
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 45 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
"parserOptions": {
"ecmaVersion": "2018"
},
"extends": ["eslint:recommended"],
"extends": ["eslint:recommended", "eslint-config-prettier"],
"rules": {
"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"
}
},
"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": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
@@ -442,6 +451,12 @@
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"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": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",

View File

@@ -5,13 +5,16 @@
"main": "index.js",
"scripts": {
"lint": "eslint src",
"format": "prettier --write \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\""
"format": "npm run prettier -- --write",
"prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
"validate": "npm run lint && npm run prettier -- --list-different"
},
"keywords": [],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"devDependencies": {
"eslint": "^5.5.0",
"eslint-config-prettier": "^3.0.1",
"prettier": "^1.14.2"
}
}

View File

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