Commit Graph

16 Commits (master)

Author SHA1 Message Date
fisker Cheung 179943ccba Update `@babel/parser` to v7.6.3 (#6386)
* fix flow_function_parentheses

* fix directives

* fix classes

* fix flow_method

* fix `do`

* fix `decorators`

* fix `comments_closure_typecast`

* fix `comments`

* fix `flow_internal_slot`

* fix `flow_comments`

* fix `flow_type_declarations`

* fix `flow_type_spread`

* fix `functional_composition`

* fix `multiparser_js_css`

* fix `no-semi`

* fix `objects`

* fix `template`

* fix `yield`

* update `flow_method` snap

* fix `empty_paren_comment`

* fix `mdx`

* fix `object_property_comment`

* Update `@babel/parser`

* Update @babel/parser to v7.6.2

* Update yarn.lock

* fix `nullish_coalescing` test

* fix `flow_class_field` test

* fix snapshot

* @babel/parser v7.6.3

* fix tests

* update snap
2019-10-09 14:52:11 +03:00
Wei-Wei Wu 91c20f7fbe Rename "babylon" with "babel" (#5647) 2018-12-27 21:05:19 +08:00
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Ika 6cedf7d5d9
fix(flow,ts): consistent interface and remove unnecessary indent for extends (#5432) 2018-11-11 00:15:18 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Nicolò Ribaudo bcfe2257f5 Wrap ?() => T in parens when needed. (#4475) 2018-05-14 11:25:16 -03:00
Lucas Duailibe 51744e1008 Print parens in FunctionTypeAnnotation when arrowParens is "always" (#3616)
* add test case

* print parens in function type annotation
2017-12-31 16:01:21 +01:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Moti Zilberman 5e146cdabe Use semicolons in Flow interface-like bodies (#2593)
Closes #2593.
2017-09-25 12:45:40 +01:00
Christopher Chedeau eeb8616e3c Add parenthesis for single arg types with generics (#1814)
Fixes #1813
2017-05-29 16:59:45 -07:00
Christopher Chedeau bafd72418e Don't break for unparenthesised single argument flow function (#1452)
This has been reported internally. It looks --very-- weird to have it indented the way it was.
2017-05-01 14:39:46 -07:00
Davy Duperron c609a5415a [experimental] Add linting step in test pipeline (#1172)
* Add eslint as dev dep, reorder scripts.

* Add tests & docs to eslintignore.

* Add eslintcache to gitignore.

* Update yarn lock file 😽.

* Add linting step in the test pipeline.

* Add a set of really basic rules for linting.

* Fix linting 🚀.

* No need for .jsx files to be linted...

* Reorder rules alphabetically.

* Refine rules: drop styling ones, only keep what provides dead code elimination.

* Add no-console rule to be consistent along with the no-debugger one.

* Remove empty line.

* Add eslint-disable-next-line no-console where console log/warn/error are allowed.

* Drop no-console rule.

* Remove eslint-disable-next-line no-console comments.

* Remove linting step in Travis CI.

* Fix linting after merging current master.

* Run `npm test -- -u` after noticing one test was out of sync.

* Drop eslint references from previous implementation.

* Revert yarn lock file.

* Revert scripts ordering.

* Fix incorrect yarn lock file.
2017-04-25 09:48:56 -07:00
Christopher Chedeau a7319dbbbb Fix optional flow parenthesis (#1357)
In #1251, we now have a proper whitelist of all the types that should have parenthesis. Turns out, it included NullableTypeAnnotation which is `?a`. For `?a => void` this wasn't needed but for `(?(a => b)) => c` it was! It's better to always put it anyway if it's not just a simple literal.

I've added tests for all the combinations I could think of, so we'll catch regressions if they happen.

Fixes #1353
2017-04-24 16:58:30 -04:00
Brian Ng 93f040a9ea Skip trailing commas with FlowShorthandWithOneArg (#1364) 2017-04-20 14:46:41 -07:00
Jan Kassens b82220b20f Prittier printing of snapshots (#1190)
This uses a custom snapshot serializer to reduce escaping in snapshot files and
make them easier to read.

Snapshot serializers are documented here:
https://facebook.github.io/jest/docs/configuration.html#snapshotserializers-array-string
2017-04-12 13:41:51 -07:00
Simon Lydell dc93bdc983 Sync the Flow tests (#1163)
* Extract custom tests from tests/flow/

Approach:

1. Remove all .js files in tests/flow except .snap.js files.
2. Copy over all .js files from tests/ in the flow repo.
3. Go through the diff looking for deletions.
   - It was easy to see which deletions were due to changes in the tests
     due to updates in the flow repo.
   - For the rest of the deletions, I used `git blame` to verify that
     they had been added by us since the flow tests were copied over.

This makes tests/flow/ simply a copy of the tests from the flow repo,
making it easier to sync with the upstream flow tests in the future.

* Add a script for syncing the flow tests

* Sync the flow tests
2017-04-08 07:52:38 -07:00