Commit Graph
5479 Commits
Author SHA1 Message Date
Georgii Dolzhykov ceb7ee62f8 typechecking: remove @typescript-eslint/types from devDependencies (#10470)
@typescript-eslint/typescript-estree reexports these types.
2021-03-06 17:10:50 +02:00
fisker Cheung 2f6580bebc Simplify babel parser (#10437) 2021-03-05 19:27:08 +08:00
Sosuke Suzukiandfisker Cheung f1b5720fc7 Remove unstable AST testing (#10462)
* Add unstable AST testing for json-stringify parser

* Deduplicate yarn.lock

* Ignore `tokens`

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-03-05 12:17:42 +02:00
Sosuke Suzuki eb5139b7a9 Remove unnecessary condition (#10032) 2021-03-05 09:24:46 +02:00
fisker CheungandGeorgii Dolzhykov 8a1ee9ad1b Support JSON6 (#10456)
* Add test

* Support JSON6

* Test

* Print `null` instead of holes

* More tests

* Update changelog

* Style

* Minor refactor

* Fix AST clean

* Fix `Identifier` clean

* Fix AST compare

* Style

* Reword changelog

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-04 19:37:42 +02:00
Georgii Dolzhykov 37aa31e929 Remove hacks for single-element unions/intersections (#10457)
* Remove hacks for degenerate unions/intersection

* Add changelog
2021-03-04 01:21:03 +02:00
Georgii DolzhykovandSosuke Suzuki 5f8fee4d07 Prevent wrapping object properties with short keys (#10335)
* Prevent wrapping object properties with short keys

* Update src/language-js/print/assignment.js

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>

* Use getStringWidth instead of .length

Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
2021-03-03 01:43:46 +02:00
fisker Cheung 2f384ab24a JSON: More JSON5 data tests (#10453) 2021-03-02 13:43:48 +08:00
fisker Cheung 2edfec5eda JSON: Better error message (#10452) 2021-03-02 13:42:49 +08:00
Georgii Dolzhykov 23b4822e66 Disable Jest's default transformer (Babel) (#10454)
* Disable Jest's default transform (Babel)

https://jestjs.io/docs/en/next/code-transformation#defaults

Otherwise, I sometimes get this error because Babel tries to resolve Browserslist:

----
  ● plugin search should not crash when prettier isn't inside a directory › encountered a declaration exception

    ENOENT: no such file or directory, stat '/mnt/d/dev/prettier/tests_integration/mnt/d/dev/prettier/tests_integration/runPrettier.js'

      52 |   jest.spyOn(fs, "statSync").mockImplementation((filename) => {
      53 |     if (path.basename(filename) === "virtualDirectory") {
    > 54 |       return origStatSync(path.join(__dirname, __filename));
         |              ^
      55 |     }
      56 |     return origStatSync(filename);
      57 |   });

      at Object.<anonymous> (tests_integration/runPrettier.js:54:14)
      at isFile (node_modules/browserslist/node.js:38:42)
      at eachParent (node_modules/browserslist/node.js:46:13)
      at Object.getStat (node_modules/browserslist/node.js:197:15)
      at browserslist (node_modules/browserslist/index.js:433:19)
      at resolveTargets (node_modules/@babel/helper-compilation-targets/lib/index.js:174:46)
----
2021-03-01 13:55:20 +02:00
fisker Cheung ed9e9ab649 Improve json error code frame (#10433) 2021-03-01 10:04:09 +08:00
fisker Cheung 7aff95cac1 Refactor semicolon check (#10355) 2021-03-01 10:03:28 +08:00
fisker Cheung 9324380c53 JSON: Disallow sparse array (#10443) 2021-03-01 09:53:32 +08:00
dependabot[bot] 1227207909 Build(deps): Bump string-width from 4.2.1 to 4.2.2 (#10448)
Bumps [string-width](https://github.com/sindresorhus/string-width) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/sindresorhus/string-width/releases)
- [Commits](https://github.com/sindresorhus/string-width/compare/v4.2.1...v4.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 09:51:25 +08:00
fisker Cheung ed64ce0f0e JSON: Allow Infinity and NaN (#10451) 2021-03-01 09:14:20 +08:00
dependabot[bot] 39c0653846 Build(deps): Bump typescript from 4.1.5 to 4.2.2 (#10425) 2021-03-01 00:10:39 +00:00
dependabot[bot] 757ed71fe8 Build(deps-dev): Bump rollup from 2.39.0 to 2.40.0 (#10444) 2021-02-28 21:06:39 +00:00
Sosuke Suzuki fc396277fc Support TS 4.2 abstract constructor signature (#10418) 2021-02-28 22:00:17 +02:00
dependabot[bot] 001189677d Build(deps): Bump @angular/compiler from 11.2.1 to 11.2.3 (#10439) 2021-02-28 19:47:12 +00:00
dependabot[bot] dbc43961b3 Build(deps): Bump unified from 9.2.0 to 9.2.1 (#10431) 2021-02-28 19:46:02 +00:00
fisker CheungandGeorgii Dolzhykov 383e17665e Refactor decorators print (#10296)
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-03-01 02:58:43 +08:00
Georgii Dolzhykov 4a8fe3bc3c Fix --debug-print-doc (#10445) 2021-02-28 20:52:57 +02:00
dependabot[bot] 92c26b0120 Build(deps): Bump @typescript-eslint/typescript-estree (#10438) 2021-02-28 18:52:01 +00:00
Georgii Dolzhykov ff7a194e8a Recreate yarn.lock 2021-02-28 18:49:56 +02:00
dependabot[bot] 5af3e4612b Build(deps): Bump meriyah from 4.1.2 to 4.1.4 (#10442) 2021-02-28 13:20:40 +00:00
dependabot[bot] 93d7132aad Build(deps): Bump string-width from 4.2.0 to 4.2.1 (#10441)
Bumps [string-width](https://github.com/sindresorhus/string-width) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/sindresorhus/string-width/releases)
- [Commits](https://github.com/sindresorhus/string-width/compare/v4.2.0...v4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 20:13:39 +08:00
dependabot[bot] bb165ae974 Build(deps-dev): Bump @rollup/plugin-replace from 2.3.4 to 2.4.1 (#10440)
Bumps [@rollup/plugin-replace](https://github.com/rollup/plugins) from 2.3.4 to 2.4.1.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/replace-v2.3.4...replace-v2.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 18:08:35 +08:00
dependabot[bot] 86b593cad5 Build(deps-dev): Bump @babel/types from 7.12.17 to 7.13.0 (#10428) 2021-02-28 08:37:38 +00:00
dependabot[bot] bf6cdea1d0 Build(deps-dev): Bump @babel/preset-env from 7.12.17 to 7.13.8 (#10436)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 15:42:57 +08:00
dependabot[bot] be957c91c7 Build(deps-dev): Bump @typescript-eslint/types from 4.15.1 to 4.15.2 (#10435) 2021-02-28 06:46:15 +00:00
dependabot[bot] b400a34a1a Build(deps-dev): Bump @babel/core from 7.12.17 to 7.13.8 (#10429)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.17 to 7.13.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-core)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 13:35:25 +08:00
dependabot[bot] 30594d30e5 Build(deps-dev): Bump webpack from 5.23.0 to 5.24.2 (#10432)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 13:34:29 +08:00
fisker Cheung c163d346d4 Extract json parser (#10405) 2021-02-28 11:38:21 +08:00
dependabot[bot] d800fd001e Build(deps-dev): Bump eslint-config-prettier from 8.0.0 to 8.1.0 (#10427) 2021-02-28 03:14:46 +00:00
dependabot[bot] 77e992b01d Build(deps-dev): Bump webpack from 5.23.0 to 5.24.2 in /website (#10430)
Bumps [webpack](https://github.com/webpack/webpack) from 5.23.0 to 5.24.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.23.0...v5.24.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 10:34:32 +08:00
dependabot[bot] 9569e3278c Build(deps): Bump actions/setup-node from v2.1.4 to v2.1.5 (#10424) 2021-02-28 01:55:15 +00:00
dependabot[bot] 4604e14730 Build(deps-dev): Bump eslint from 7.20.0 to 7.21.0 (#10426) 2021-02-28 01:49:32 +00:00
dependabot[bot]andsosukesuzuki 478107836d Build(deps): Bump @babel/parser from 7.12.11 to 7.13.4 (#10397)
* Build(deps): Bump @babel/parser from 7.12.11 to 7.13.4

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.12.11 to 7.13.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.4/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Add unstable AST compare testing

* Remove error tests for this type with babel-flow

* Fix typo

* Add changelog

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-02-26 22:04:53 +09:00
fisker Cheung 95c8086c2c Add flat-ast-path-call rule (#10354) 2021-02-26 09:26:50 +08:00
fisker Cheung 64a3906571 Enable unicorn/prefer-optional-catch-binding (#9464) 2021-02-25 18:28:55 +08:00
Sosuke Suzuki feacf82892 Update babel/parser to v7.12.17 (#10345) 2021-02-25 18:28:06 +08:00
Georgii Dolzhykov 285c15ef08 docs: how to ignore files using negative patterns (#10400) 2021-02-24 21:47:07 +02:00
fisker Cheung 5682d2f440 Add printDirective (#10396) 2021-02-24 02:29:50 +08:00
Georgii Dolzhykov 3dfdb2cff5 Add Support Requests bot config file (#10387) 2021-02-23 20:17:15 +02:00
dependabot[bot] bf99d34fcb Build(deps-dev): Bump concurrently from 5.3.0 to 6.0.0 in /website (#10363) 2021-02-23 15:01:28 +00:00
dependabot[bot] 975e77ea4f Build(deps): Bump flow-parser from 0.144.0 to 0.145.0 (#10368) 2021-02-23 14:57:21 +00:00
Georgii Dolzhykov ec27ade49b Heuristic for grouping parameters in method signatures (#10357)
* Heuristic for grouping parameters in method signatures
* Apply the same logic to function declaration and Flow types
* Group only if there is only one parameter
* Don't group if type param has constraints/default or >1 type param
2021-02-23 16:38:56 +02:00
fisker Cheung d544585d87 Make JSON parser stricter (#10346) 2021-02-23 13:33:10 +02:00
dependabot[bot]andGeorgii Dolzhykov eea7d11883 Build(deps): Bump linguist-languages from 7.12.2 to 7.13.0 (#10379)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-02-23 13:07:46 +08:00
fisker Cheung f392c7c526 Simplify JS locEnd (#10389) 2021-02-23 12:43:38 +08:00