Summary:
- add type to represent the returned component tree
```
expected data:
{
[nodeID1]: [subtree1],
[nodeID2]: [subtree2],
...
}
example:
{
id1: {
id2: {
id3: {
id4: {},
id5: {
id6: {}
}
}
}
}
}
```
- add functions to deal with a tree
- `_getElementLeaves` for finding ids that don't have any child given the tree structure
- `_getPathForNode` for finding path (similar to previous path parameter) for given id
- This diff still retain functionality in case of selector appear to touch only one element.
Reviewed By: mweststrate
Differential Revision: D21040427
fbshipit-source-id: e6704535a437ad47d9664cc16896b9f24c9d6736
Summary: Added eslint rule "no-extraneous-imports" which disallow using modules which are not listed as dependencies in the corresponding package.json. Fixed a bunch of reported errors after the rule applied.
Reviewed By: passy
Differential Revision: D21186848
fbshipit-source-id: 0af9ac4b3fffdfd0ab7c23ae4ff12a3f5989d5e9
Summary:
Quick notes:
- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.
Close https://github.com/facebook/flipper/pull/915
Reviewed By: jknoxville
Differential Revision: D20594929
fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03