Skip to content

Commit

Permalink
fix: Upgraded prettier and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantoine committed Apr 13, 2017
1 parent cc87510 commit d709d04
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 41 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "babel src -d build && babel src/serializer.js -o serializer.js",
"prepublish": "yarn build",
"lint": "eslint src tests/core",
"format": "prettier src/**/*.js tests/core/**/*.js --write --print-width=100 --single-quote --trailing-comma --no-bracket-spacing",
"format": "prettier src/**/*.js tests/core/**/*.js --write --single-quote --trailing-comma all --no-bracket-spacing",
"test": "yarn lint && yarn test-core && yarn test-serializer",
"test-core": "NODE_ENV=test jest --coverage",
"lint-staged": "lint-staged",
Expand Down Expand Up @@ -72,7 +72,7 @@
"jest": "~19.0.2",
"lint-staged": "^3.4.0",
"pre-commit": "~1.2.2",
"prettier": "^0.22.0",
"prettier": "^1.0.2",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
Expand Down
2 changes: 1 addition & 1 deletion src/mount.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function instToJson(inst) {
const type = typeName(currentElement);
const props = omitBy(
propsOfNode(currentElement),
(val, key) => key === 'children' || val === undefined,
(val, key) => key === 'children' || val === undefined
);
const children = [];
if (isDOMComponent(publicInst)) {
Expand Down
8 changes: 3 additions & 5 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ const renderChildToJson = child => {
return {
type: child.name,
props: child.attribs,
children: (
child.children && child.children.length
? compact(child.children.map(renderChildToJson))
: null
),
children: child.children && child.children.length
? compact(child.children.map(renderChildToJson))
: null,
$$typeof: Symbol.for('react.test.json'),
};
} else if (child.type === 'text') {
Expand Down
11 changes: 4 additions & 7 deletions src/shallow.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ function nodeToJson(node) {
}

if (isPlainObject(node)) {
return entries(node).reduce(
(obj, [key, val]) => {
obj[key] = nodeToJson(val);
return obj;
},
{},
);
return entries(node).reduce((obj, [key, val]) => {
obj[key] = nodeToJson(val);
return obj;
}, {});
}

return node;
Expand Down
44 changes: 18 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,9 @@ assert-plus@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234"

[email protected]:
version "0.8.18"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af"

[email protected]:
version "0.9.4"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.4.tgz#410d1f81890aeb8e0a38621558ba5869ae53c91b"
[email protected]:
version "0.9.8"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078"

async-each@^1.0.0:
version "1.0.1"
Expand Down Expand Up @@ -778,7 +774,11 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1:
lodash "^4.2.0"
to-fast-properties "^1.0.1"

[email protected], babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0:
[email protected]:
version "7.0.0-beta.8"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949"

babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0:
version "6.15.0"
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e"

Expand Down Expand Up @@ -1028,10 +1028,6 @@ color-name@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d"

colors@>=0.6.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"

combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
Expand Down Expand Up @@ -1769,13 +1765,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

[email protected]:
version "0.40.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc"
dependencies:
ast-types "0.8.18"
colors ">=0.6.2"
minimist ">=0.2.0"
[email protected]:
version "0.43.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7"

[email protected]:
version "0.0.7"
Expand Down Expand Up @@ -3097,7 +3089,7 @@ [email protected], minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"

[email protected], minimist@>=0.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
[email protected], minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

Expand Down Expand Up @@ -3566,16 +3558,16 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@^0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-0.22.0.tgz#7b37c4480d0858180407e5a8e13f0f47da7385d2"
prettier@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.0.2.tgz#84535548fca00cf0acd7ca8296d492352ef167d7"
dependencies:
ast-types "0.9.4"
ast-types "0.9.8"
babel-code-frame "6.22.0"
babylon "6.15.0"
babylon "7.0.0-beta.8"
chalk "1.1.3"
esutils "2.0.2"
flow-parser "0.40.0"
flow-parser "0.43.0"
get-stdin "5.0.1"
glob "7.1.1"
jest-validate "19.0.0"
Expand Down

0 comments on commit d709d04

Please sign in to comment.