Commit Graph

7 Commits (master)

Author SHA1 Message Date
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
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
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Christopher Chedeau 62b9e29af5 Fix comments in non strict mode (#2114)
It turns out that by returning there, we didn't go through the line `delete ast.tokens` and the comments attachment logic would attach it to a random token. It's great that this fail-safe caught this bug!

Fixes #2111
2017-06-12 09:50:51 -07:00
Lucas Azzola 2a58e6bc06 test(typescript): enable typescript-verify on most tests (#1781) 2017-05-27 17:57:07 -07:00
Joseph Frazier 5ca2117d23 (Babylon) Fall back to non-strict mode (#1587)
* (Babylon) Fall back to non-strict mode

This makes Prettier a little less opinionated about linting. For
example, the following can now be formatted:

```js
function f(a,a){return a}
```

whereas before it would cause an error:

    stdin: SyntaxError: Argument name clash in strict mode (1:13)
    > 1 | function f(a,a){return a}
        |              ^

This also allows octal numbers to be parsed,
and therefore fixes https://github.com/prettier/prettier/issues/228

If the code parses neither as strict nor as non-strict, the error from the
strict parse is thrown (as it was before this change).

---

I noticed this while trying out [eslump] with prettier:

    eslump | pbcopy; pbpaste | prettier

[eslump]: https://github.com/lydell/eslump

* Add missing test

* Use Object.assign() instead of mutating object
2017-05-12 07:32:27 -07:00