Commit Graph
53 Commits
Author SHA1 Message Date
Sosuke Suzukiandfisker Cheung fa3b95c2e1 Remove lodash (#12628)
* Replace `groupBy`

* Replace `partition`

* Replace `pick`

* Move `partition`

* Replace `uniqBy`

* Replace `fromPairs`

* Remove usage from website

* Reuse `partition`

* Remove from package.json

* Fix

* Use `ignore.default`

* Add `resolveConfig` to `FileInfoOptions`

* Explicit tuple types

* Make `cache` optional

* Fix cosmiconfig type

* Use `@ts-expect-error` for private property access

* Add type annotation for validate

* Fix type errors for `OptionInfo`

* Add `@ts-expect-error`

* Fix type of `normalizeOptions`

* Fix `OptionInfo` type

* Add `@ts-expect-error` for `option-normalizer`

* Avoid type error

* Fix typo

* Add types for lodash fns

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-10 15:26:07 +09:00
Simen Bekkhus 033ac94f25 chore: disable string escaping in snapshots (#12612) 2022-04-08 09:59:17 +09:00
Harry Hopkinsonandfisker Cheung f98c197b66 Print the number of files that need formatting. (#12561)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-04-07 09:47:13 +08:00
fisker Cheung 3fd64b4f30 Format .importmap file with json-stringify parser (#12603) 2022-04-07 09:37:30 +08:00
dependabot[bot] f4d4dc1177 Build(deps): Bump strip-ansi from 6.0.0 to 7.0.0 (#10731) 2022-04-02 11:24:18 +00:00
fisker Cheung afd0220dea Move some bundle test code into tests/ (#12577) 2022-04-02 16:14:32 +08:00
fisker Cheung 5ef82125a9 CLI: Don't use logger to print information (#12477) 2022-03-21 10:38:48 +08:00
fisker Cheung ef3fe51380 Fix pluginSearchDirs schema (#12474)
* Fix `pluginSearchDirs` schema

* `anyOf` -> `oneOf`

* Fix test
2022-03-20 14:50:27 +09:00
fisker Cheung ae080df3e7 Enable unicorn/template-indent rule (#12469) 2022-03-17 20:13:28 +08:00
fisker Cheung 5a50a0d909 Bundle bin and cli separately (#12306) 2022-03-13 22:47:02 +08:00
fisker CheungandAlexander Kachkaev 3ba48bb266 Add --no-plugin-search (#10274)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2022-02-18 16:36:53 +08:00
Sosuke Suzuki 162097e2d2 Format .swcrc as a JSON file (#12320)
* Format `.swcrc` as JSON

* Test `.swcrc` JSON formatting

* Add changelog

* Update snapshots

* Address reviews

* Update `cspell.json`

* Address review
2022-02-18 08:39:12 +09:00
Sosuke Suzuki b14b13d2cf Update tempy to 2.0.0 (#12247)
* Update `tempy`

* require `tempy` directly

* Fix

* Fix

* Vendors

* Remove `vendord.d.tsd`

* Fix path
2022-02-12 18:23:50 +09:00
fisker Cheung d962466a82 Style: Enforce kebab-case filename (#12265) 2022-02-10 10:12:31 +08:00
dependabot[bot] b1645073b8 Build(deps): Bump @babel/parser from 7.16.12 to 7.17.0 (#12241) 2022-02-07 06:15:31 +00:00
Bogdan Chadkin 76bb0226d5 Replace globby with fast-glob (#12223)
There is already fast-glob used in src/cli/expand-patterns.js
Here I migrate everywhere to it from globby which is a thin wrapper with
a couple of unused here features.

```
du -ck dist
```
17280 kB
17260 kB
2022-02-05 10:24:10 -03:00
fisker Cheung 9691e7bc37 Add acorn parser (#12172) 2022-01-28 15:25:30 +08:00
fisker Cheung 07f7ad8c79 Improve shorthand specifier detection (#11941) 2021-12-18 11:16:18 +08:00
fisker Cheung 306d009904 Use camelCase cli arguments internally (#11976) 2021-12-18 11:11:49 +08:00
fisker Cheung 6317e6557e Test: Make runPrettier result "thenable" (#11979) 2021-12-18 11:10:03 +08:00
fisker Cheung 326f23cd35 Restructure cli files (#11974) 2021-12-16 09:21:15 +08:00
Jere Kankaanrantaandfisker Cheung 82e6937d50 Added changelog and updated the "first available in" version for singleAttributePerLine (#11934)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-12-07 14:13:26 +08:00
Jere Kankaanranta 0e42acb49b feat: added singleAttributePerLine option (#5501) (#6644) 2021-12-02 11:46:11 +03:00
fisker Cheung 16b6825172 Make options argument in parsers optional (#11892) 2021-12-02 13:56:47 +08:00
Sosuke Suzuki fb7080f82d Handle TypeScript 4.5 new file extensions .mts and .cts (#11721)
* Handle .mts and .cts

* Update integration tests

* Add changelog
2021-10-30 20:56:12 +09:00
Sosuke Suzuki 8c23c58b7e Enable jest/prefer-to-be (#11627) 2021-10-04 07:46:38 +09:00
Sosuke SuzukiandGeorgii Dolzhykov aa63269743 Add new CLI option debug-print-ast (#11514)
* Add new CLI option debug-print-ast

* Add tests

* Add changelog

* Remove text from ast

* Update tests/integration/__tests__/debug-print-ast.js

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>

* Update tests

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-09-15 21:03:04 +09:00
fisker Cheungandsosukesuzuki 07786bd758 Revert "Revert features for minor" (#11044)
* Revert "Revert features for minor (#11016)"

This reverts commit 09d65c35af.

* Update cspell.json

Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-08-31 13:40:52 +09:00
4992d97203 Deprecate jsxBracketSameLine option in favour of multi-language bracketSameLine option (#11006)
* deprecate jsxBracketSameLine in favour of multi-language angleBracketSameLine option

* update docs and snapshots

* update tests to to make them more reviewable

* Rewrite angular tests

* Rewrite html tests

* Rewrite vue tests

* Restore unnecessary changes in jsx

* Fix file location

* Test both `true` and `false`

* Revert changes in markdown

* Run tests on all js parsers

* Improve html test

* fix changelog comment

* move bracketSameLine to common options

* mark jsxBracketSameLine as deprecated

* Update changelog_unreleased/html/11006.md

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* Update 11006.md

* fix tests by removing `jsxBracketSameLine` `default` property

* fix style

* Revert docs under website dir

* Add tests for deprecated options

* Fix lint problems

Co-authored-by: fisker Cheung <lionkay@gmail.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
2021-08-31 11:47:50 +09:00
fisker Cheung 776b3ff13d Recognize zx interpreter (#11238) 2021-07-22 09:44:42 +08:00
fisker Cheung 894f841fbd Style: Enforce extensions (#11227) 2021-07-21 09:10:34 +08:00
Sosuke Suzukiandfisker Cheung 4d8871c106 Migrate generate-schema script to ESM (#11226)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-07-20 19:25:54 +08:00
fisker Cheung 57616ad865 Enable no-return-await and require-await rule, fix clean-cspell script (#11079) 2021-06-16 22:20:47 +08:00
Sosuke Suzuki 3332a28aaf Update generate-schema script (#11043)
* Support custom parser and use anyOf

* Update snapshots
2021-06-11 14:04:51 +09:00
fisker Cheung ce96e4899f CLI: Fix failure on dir with trailing slash (#11000) 2021-06-11 11:03:42 +08:00
Sosuke Suzuki 09d65c35af Revert features for minor (#11016)
This reverts commit f8cb785758.
2021-06-05 18:32:49 +09:00
dependabot[bot]andfisker Cheung ddcfdd47f3 Build(deps): Bump linguist-languages from 7.14.0 to 7.15.0 (#10990)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-06-01 10:29:22 +08:00
fisker Cheung c286d847d9 Remove more Array#reduce() (#10907) 2021-05-24 01:26:00 +03:00
Domaandfisker Cheung f8cb785758 Support stylelintrc (#10924)
* Infer JSON/YAML parser for .stylelintrc

* Update test snapshots

* Update src/language-yaml/embed.js

Co-authored-by: fisker Cheung <lionkay@gmail.com>

* Add changelog for stylelintrc support

* Update embed.js

* style: Fix prettier linting problems

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-05-24 01:24:32 +03:00
fisker Cheung e161350309 Use fsPromises in CLI (#10852) 2021-05-12 01:05:54 +08:00
fisker Cheung b7983971ce Drop Node.js 10 support for development "build" (#10842) 2021-05-11 08:52:38 +08:00
fisker Cheung 6e71422548 Use async APIs in CLI (#10841)
* Use async API in CLI

* Remove `synchronous-promise`
2021-05-11 01:50:50 +03:00
Georgii Dolzhykov 3d8dc612b5 Bump Prettier dependency to 2.3.0 2021-05-10 00:07:47 +03:00
164a6e2351 Switch CLI to async (#10804)
* Switch CLI to async

* Rewrite test

* Fix tests

* Comment out failed test

* Comment out failed test

* Fix test

Co-authored-by: Connor Peet <connor@peet.io>

* Update patterns-dirs.js

* Fix `hasRunningCli` flag

* Fix grammar

* Update tests/integration/runPrettier.js

Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>

Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
2021-05-09 15:43:10 +03:00
Sosuke Suzuki 63c744823b Update babel parser (#10802)
* Update

* Use error codes instead of error messages

* Update js tests

* Update ts tests

* Add comments

* Remove plugins enabled by default

* update misc error tests

* Remove moduleStringNmaes

* use allowedMessagesCode directly

* Remove some misc tests

* Update snapshots for integration tests

* Add Redeclaration to cspell.json
2021-05-03 12:12:25 +09:00
dependabot[bot]andfisker Cheung 21d4f4e3a9 Build(deps): Bump linguist-languages from 7.13.0 to 7.14.0 (#10755)
* Build(deps): Bump linguist-languages from 7.13.0 to 7.14.0

Bumps [linguist-languages](https://github.com/ikatyang/linguist-languages) from 7.13.0 to 7.14.0.
- [Release notes](https://github.com/ikatyang/linguist-languages/releases)
- [Commits](https://github.com/ikatyang/linguist-languages/compare/v7.13.0...v7.14.0)

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

* Update snapshot

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2021-04-26 01:11:35 +03:00
fisker Cheung ece93681f1 Restructure test files (#10415) 2021-04-25 20:01:56 +08:00
Christopher Chedeau 3375cfe605 Move tests around (#454)
* new_tests

* move_all_clobbered_tests

* remove all the tests that no longer exist

* re-run flow tests

* Move all the flow tests to tests/flow and prettier to tests/

* Move prettier tests to their own folders

* Add jsfmt files

* run prettier snapshot tests
2017-01-24 14:35:37 -08:00
James Long 00fad62c91 Regenerate snapshots 2017-01-11 10:16:38 -05:00
James Long a4643f1bae Add special case for comment at top of file; regenerate snapshots 2017-01-09 21:49:26 -05:00