Commit Graph
100 Commits
Author SHA1 Message Date
Sosuke Suzuki 1af485ad26 Bump Prettier dependency to 3.3.0 2024-06-02 02:04:40 +09:00
Sosuke Suzuki 0eaed3ef68 Update dependents count 2024-06-02 02:04:21 +09:00
Sosuke Suzuki c4ab460357 Release 3.3.0 2024-06-02 02:01:15 +09:00
SUZUKI Sosuke a32fca0726 Fix tests on Node.js 14 x MacOS (#16250)
Tests on Node.js 14 x MacOS
2024-04-30 22:44:35 +09:00
SUZUKI Sosuke 55ddfab5e8 Run tests on Node 22 (#16247) 2024-04-30 22:18:49 +09:00
SUZUKI Sosuke 06c9d77bc5 perf: Use logical expression instead of regexp for isUnitTestSetUp (#16035) 2024-02-08 23:05:58 +09:00
SUZUKI Sosukeandfisker a642ecb373 Unquote keys in import attributes (#15888)
Co-authored-by: fisker <lionkay@gmail.com>
2024-02-07 14:54:39 +08:00
SUZUKI Sosuke d170b8f31d perf: Add fast path for printNumber (#16034)
* Add fast path to `printNumber`

* Remove code point check!
2024-02-06 16:05:17 +09:00
SUZUKI Sosukeandfisker Cheung cc6435cc75 Use "json" parser for tsconfig.json by default (#16012)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2024-02-03 18:49:18 +08:00
SUZUKI Sosuke 2fe7f4193a Support Angular inline styles as single template literal (#15968) 2024-01-21 18:10:21 +09:00
SUZUKI Sosuke cb8004f3f1 Fix formatting error on optional call expression and member chain (#15920) 2024-01-14 11:50:28 +09:00
SUZUKI Sosuke 7e862bbc41 Fix formatting error on member chain (#15915) 2024-01-13 04:12:55 +09:00
SUZUKI Sosuke 12f91dd1a9 Use ISOString for getFormattedDate (#15914)
Use `ISOString`
2024-01-13 03:42:19 +09:00
SUZUKI SosukeandAlexander Kachkaev 1890d55900 3.2 blog post (#15892)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2024-01-13 01:28:32 +09:00
SUZUKI SosukeandAlexander Kachkaev c9fc23e0e7 Update issue template (#15886)
Co-authored-by: Alexander Kachkaev <alexander@kachkaev.ru>
2024-01-13 00:09:16 +09:00
SUZUKI Sosuke 6432f9b931 Add clean-changelog step to release script (#15890)
* Add clean-changelog-unreleased to release script

* Skip for beta release

* Rename to clean changelog
2024-01-08 15:20:27 +09:00
SUZUKI Sosuke 06c7e52da6 Avoid adding colon for track in 3rd expression of for blocks (#15887) 2024-01-08 15:20:06 +09:00
SUZUKI Sosuke 5c6450db9c Clean changelog for 3.1.1 (#15889)
Clean changelogs
2024-01-07 23:52:00 +09:00
SUZUKI Sosuke 66a23c9331 Run fix:eslint (#15847) 2023-12-28 23:53:44 +09:00
SUZUKI Sosukeandfisker 863368e1ba Add --next flag to release script (#15816)
Co-authored-by: fisker <lionkay@gmail.com>
2023-12-17 22:51:37 +09:00
SUZUKI Sosukeandfisker 153ffd5104 Support formatting for Angular ICU expression (#15777)
Co-authored-by: fisker <lionkay@gmail.com>
2023-12-14 13:01:54 +09:00
SUZUKI Sosuke 56408635eb Add simple lint script for blog post (#15737) 2023-12-01 13:29:30 +09:00
SUZUKI Sosuke da1d4e9301 Fix blog date and add truncate comment (#15736) 2023-12-01 01:03:47 +08:00
SUZUKI Sosukeandfisker 8d64505bd4 Update cspell.json (#15722)
Co-authored-by: fisker <lionkay@gmail.com>
2023-11-28 09:48:14 +08:00
SUZUKI Sosuke 0ba2d693ba Fix unstable and ugly formatting for comments in destructuring patterns (#15708) 2023-11-24 00:56:14 +09:00
SUZUKI Sosuke 093745f0ec Enable --experimental-ternaries in playground (#15677) 2023-11-18 15:41:34 +08:00
SUZUKI Sosuke 79da291f72 Revert "Revert "Add blog post for experimental ternaries"" (#15618) 2023-11-13 12:01:53 +09:00
SUZUKI Sosukeandfisker Cheung 62d0c22638 Add 3.1 blog post (#15503)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-11-13 12:01:29 +09:00
SUZUKI Sosuke cb93aaf18a Revert "Add blog post for experimental ternaries" (#15602)
Revert "Add blog post for experimental ternaries (#15594)"

This reverts commit 1d8ee821ed.
2023-11-07 11:20:49 +09:00
SUZUKI Sosuke f736f2deb4 Update angular-html-parser to v5 (#15569)
* Use new `angular-html-parser`

* Update to 5.0.1
2023-10-29 23:35:11 +09:00
SUZUKI Sosuke 1d45bce625 Consistently format strings containing escapes (#15525) 2023-10-29 21:52:38 +09:00
SUZUKI Sosuke 44af877554 Run full test on Node.js 20 (#15565)
Run `FULL_TEST` on Node.js 20
2023-10-29 12:23:56 +09:00
SUZUKI Sosuke f852b8010e Improve formatting for assignment its left can break (#15547) 2023-10-28 14:29:17 +09:00
SUZUKI Sosuke 56945ecf12 Update trailingComma: es5 document (#15555) 2023-10-28 01:52:39 +09:00
SUZUKI Sosuke d0b907620b Run ./scripts/clean-cspell.js (#15508)
Run clean-cspell
2023-10-11 01:58:56 +09:00
SUZUKI Sosuke 5cfb76ee50 Add *.cpuprofile file to .gitignore (#15507) 2023-10-10 11:24:12 +09:00
SUZUKI Sosuke 4b432496df Support deferred import evaluation and source phase import syntax (#15487) 2023-10-09 08:52:48 +09:00
SUZUKI Sosuke edfe46051f Support optional chaining assignment (#15488) 2023-10-09 08:36:11 +09:00
SUZUKI Sosuke 14ddf452c4 Update @babel/parser to 7.23.0 (#15485) 2023-10-08 22:26:13 +08:00
SUZUKI Sosuke fa8cb85434 Support type arguments after typeof (#15466) 2023-09-28 12:57:38 +09:00
SUZUKI Sosuke 9f06cdd5b0 Process files only supported by plugins (#15433) 2023-09-25 14:45:01 +09:00
SUZUKI Sosuke 4169dbb871 Fix printing comment for the last operand of union types (#15409) 2023-09-16 21:52:02 +09:00
SUZUKI Sosuke c041f3fb4f Support embedded formatting in template literals annotated with as const (#15408) 2023-09-16 21:42:17 +09:00
SUZUKI Sosukeandfisker Cheung 1ce97d13a3 Support TypeScript 5.2 using / await using declaration (#15321)
* Update `@typescript-eslint` packages

* Install `typescript`

* Tweaks snapshot tests

* Tweaks error files

* Add tests for `using` with types

* Add changelog

* Update misc tests

* Update snapshots

* Revert misc tests and remove `typescript`

* Update changelog_unreleased/typescript/15321.md

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

* Fix file name typo

* Keep valid file

* Update tests

* Update changelog_unreleased/typescript/15321.md

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

* Remove non-existing filenames.

---------

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-08-29 15:51:50 +09:00
SUZUKI Sosukeandfisker Cheung a73cfa0ec4 Fix build script --report option (#15323)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-08-29 14:50:01 +08:00
SUZUKI Sosuke 90fab608ae Do not print trailing commas in arrow function type parameter lists in ts code blocks (#15286)
* Remove trailing comma for `ts` code blocks

* Add changelog

* Support `typescript`

* Update link

* Update tests
2023-08-24 17:02:56 +09:00
SUZUKI Sosuke 1b0c756bd6 Print declare and export keywords for nested namespace (#15249) 2023-08-15 22:38:07 +09:00
SUZUKI Sosuke c3d53dce7e Fix runYarn function in release script (#15200)
* Maybe it works

* Remove `--silent`
2023-08-03 14:45:48 +09:00
SUZUKI Sosuke 6e5dee0a01 Fix release script (#15016) 2023-07-07 14:44:39 +08:00
SUZUKI Sosuke 9bc62769a9 Fix 3.1 -> 3.0 (#15012)
* Fix 3.1 -> 3.0

* Run prettier
2023-07-05 22:20:39 +09:00
SUZUKI Sosuke c9d62c0690 V3 blog post (#13436) 2023-07-05 21:59:08 +09:00
SUZUKI SosukeandNicolò Ribaudo 7ad852636d Support Import Attributes (#14863)
* Print import attributes

* Update visitor keys for import attributes

* Update snapshots for visitor-keys

* Update `babel-plugins` tests

* Update import attributes tests

* Update misc tests

* Add changelog

* Enable `importAttributes` and `importAssertions`

* Print ImportAssertion syntax

* Add `babel-plugins` tests

* Add import assertions tests

* Add misc tests for import assertions

* Update changelog

* Fix words

* Use `deprecatedAssertSyntax`

* Update `@babel/parser`

* Use deprecatedAssertSyntax

* Remove needless tests

* Update `@babel/types`

* Update visitor-keys

* Run `yarn dedupe`

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

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>

* Address review

---------

Co-authored-by: Nicolò Ribaudo <hello@nicr.dev>
2023-05-31 00:47:12 +09:00
SUZUKI Sosuke 4d7afff735 Tests for await using syntax (#14862)
* Add tests for `await using`

* Add tests for `await using` from Babel

* Add changelog

* Fix changelog
2023-05-29 20:50:18 +09:00
SUZUKI Sosuke c1296105f3 Update @babel/parser to 7.22.0 (#14861)
* Update `@babel/parser` and `@babel/types`

* Update error message snapshots

* Run `yarn dedupe`

* Update `@babel/generator`

* Install new `@babel/parser`
2023-05-27 22:06:34 +09:00
SUZUKI Sosuke 6cff2148a3 Improve formatting for constraints on type parameters (#14858) 2023-05-26 22:04:43 +08:00
SUZUKI Sosuke f624507259 Print line breaking after file path with errors (#14788) 2023-05-04 17:51:14 +09:00
SUZUKI Sosukeandfisker Cheung 31583ce14c Run tests on Node.js 20 (#14721)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-04-22 22:21:02 +08:00
SUZUKI Sosukeandfisker Cheung cfb3b87efb Fix trailing coma print in type prameters, improve jsx parse (#14688)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-04-21 13:18:29 +08:00
SUZUKI Sosuke 4a949a2f23 Line breaking after extends in type parameters (#14672) 2023-04-09 12:58:54 +09:00
SUZUKI Sosuke a478b466a7 Ignore *.0x directory (#14650) 2023-04-03 11:08:33 +09:00
SUZUKI Sosuke 0f30b5cd1f Remove /vendors and /scripts/vendors from .gitignore (#14649) 2023-04-03 11:07:49 +09:00
SUZUKI Sosukeandfisker 54add8cfe8 Fix previous Prettier path in draft-blog-post script (#14636)
Co-authored-by: fisker <lionkay@gmail.com>
2023-04-01 13:21:24 +09:00
SUZUKI Sosukeandfisker 5ffa094a2f lint-changelog should warn for second template comment (#14608)
Co-authored-by: fisker <lionkay@gmail.com>
2023-03-28 16:29:46 +09:00
SUZUKI Sosukeandfisker Cheung 00e59ed008 Transform .at to property access to improve performance (#14590)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-03-26 04:14:48 +09:00
SUZUKI Sosuke 0b6d400cf8 Add docs for pnpm (#14455) 2023-03-06 14:03:06 +09:00
SUZUKI Sosukeandfisker Cheung 813df18df6 Moves @types/prettier to this repository (#14212)
* Rename `types` to `thirs-party-types`

* Copy `index.d.ts` from `@types/prettier`

* Make public APIs async

* Add missing `formatAST`

* Fix `CustomParser`

* Fix `Parser.parse` signature

* Add comment

* Add `standalonw.d.ts`

* first implement

* Fix path

* Add missing parser `.d.ts`

* Fix

* Fix path

* Introduce valid tests

* Add unit tests for dts files

* Add unit tests

* Simplify unit testing

* Tweaks structures

* Revert needless change

* Fix types path

* Introduce `ts-expect`

* Fix doc utils api

* Add AstPath API

* Fix API

* Fix tests

* Fix changelog

* Move dts

* Update module specifiers

* Remove generate dts config file

* Update build scripts

* Fix type errors

* Refactor with namespace imports

* Update comments

* Fix build script

* Improve build script

* `typing` -> `types`

* Clean up

* Minor tweak

* Minor tweak

* Modify `exports` field

* Fix paths in builder

* Refactor

* Refactor

* Address review

* Update changelog

* Address reviews

* Remove `since` from tests

* Improve utils type def

* Mark deprecated methods

* Address review

* Move docs types

* Address review

* Update c8 config

* Minor tweak

---------

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-02-23 22:15:18 +09:00
Sosuke Suzuki f65700ff88 Minor refactors for printer-graphql.js (#14233) 2023-01-27 11:31:10 +09:00
Sosuke Suzuki 2ed898dfb7 Import fs/promises directly in test files (#14235)
Import `fs/promises` directly
2023-01-26 12:15:53 +09:00
Sosuke Suzuki a37ce0b8f6 Clean changelog_unreleased (#14144)
Clean changelog
2023-01-09 16:48:32 +09:00
Sosuke Suzukiandfisker Cheung 0c5d4f3458 Fix removing commas from function arguments in maps (#14089)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-01-06 17:13:41 +09:00
Sosuke Suzuki e92dcbd1a5 Add new ESLint prefer-ast-path-node (#13470)
* Add new lint rule `prefer-path-get-value`

* Add new rule

* Apply fix

* Ingore projects in benchmark

* Add comment
2022-09-11 18:39:06 +09:00
Sosuke Suzuki e3ef1e4566 Drop Node.js 14 for development build (#13439)
* Drop Node.js 16 for development

* Fix engine

* Address review
2022-09-08 01:03:45 +09:00
Sosuke Suzuki 1142cf0cb7 Fix generate truncate comment (#13437)
Fix condition
2022-09-07 18:11:10 +09:00
Sosuke Suzuki 40af3ed1ca Keep trailing-comma for var function (#13402)
* Keep trailing-comma for last el

* Make hasComma function

* Fix tests

* Add changelog
2022-08-31 00:59:34 +09:00
Sosuke Suzuki 68bd87b24b Fix generated changelog comment for css like syntax (#13403)
Fix generated comment for css like syntax
2022-08-31 00:59:20 +09:00
Sosuke Suzukiandfisker Cheung 726ad132d8 Update Jest to v29 (#13355)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-08-28 20:02:55 +08:00
Sosuke Suzuki 503045c050 Use import() for postcss parsers (#13277)
* Import core parsers

* Import media parser

* Import selector parser

* Import value parser

* Remove require

* Improve imports

* Fix bundle config
2022-08-15 22:30:46 +09:00
Sosuke Suzukiandfisker Cheung 7d74e821e0 Use import() for html parser (#13270)
* Use `import()` for html parser

* Update src/language-html/parser-html.js

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

Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-08-12 23:49:45 +09:00
Sosuke Suzuki b12396d69a Change --loglevel to --log-level (#13204)
* Change `--loglevel` to `--log-level`

* Update tests

* Update docs

* Add changelog
2022-08-02 09:39:41 +09:00
Sosuke SuzukiandHolger Jeromin 955553bb39 Add --cache-location option (#13019)
* Implement searching cache file from `--cache-location` option

* Add tests

* Add docs

* Fix

* Fix doc

* Add changelog

* Update snapshots

* Update docs

* Update docs/cli.md

Co-authored-by: Holger Jeromin <mailgithub@katur.de>

* Fix changelog

* Remove directory support

* Update docs

* Update tests

* Update docs

* Add validation for dir

* Fix comment

* Update option description

* Validate JSON

* Use `path.resolve`

Co-authored-by: Holger Jeromin <mailgithub@katur.de>
2022-07-31 22:58:05 +09:00
Sosuke Suzuki 6c722c7990 [next]Enforce fs/promises (#13119)
* Add new ESLint rule `prefer-fs-promises`

* Apply rule

* Renaming
2022-07-17 16:02:22 +09:00
Sosuke Suzuki 75c8d46ab4 Drop Node.js 12 Support (#13118)
* Drop Node.js 12 Support

* Update CHANGELOG

* Update build target

* Comment out

* Remove node 14 from `exclude`

* Update CI

* Update changelog_unreleased/api/11830.md
2022-07-17 04:26:27 +09:00
Sosuke Suzuki 33fcc6c4dd Update requirements (#13117) 2022-07-17 00:08:47 +09:00
Sosuke Suzuki 89f90fc013 Insert spaces in pipe (#13100)
* Insert spaces to pipe arguments

* Update snapshots

* Add changelog

* Fix lint problem
2022-07-16 17:18:55 +09:00
Sosuke Suzuki ae3dd17114 Refactor: Extract printEndOfOpeningTag (#13086)
* Refactor

* Rename

* Fix typo
2022-07-09 20:05:27 +09:00
Sosuke Suzuki fde0b49d78 Run prettier 2022-06-18 21:49:24 +09:00
Sosuke Suzuki 6b388faa50 Add truncate 2022-06-14 15:36:02 +09:00
Sosuke Suzukiandfisker Cheung 934068ac6a Add 2.7 blog post (#12966)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2022-06-14 14:25:40 +08:00
Sosuke Suzuki 2316e2fecd Update linguist-language (#12994)
* Install new `linguist-language`

* Remove `.mts` and `.cts`

* Update tests
2022-06-12 01:55:11 +09:00
sosukesuzuki e5868ad368 Update changelog 2022-06-11 23:36:35 +09:00
Sosuke SuzukiandSimon Lydell fdccc0f48e Add --cache CLI option (#12800)
* Install `file-entry-cache` and types

* Implement `FormatResultsCache`

* Add `--cache` and `--cache-location` option

* Implement `--cache` and `--cache-location`

* Add tests for `--cache`

* Add tests for `--cache-location`

* Avoid spellcheck error

* Update snapshots for new options

* Add `groupBy` for website

* Use `fs.promises` instead of `fs/promises`

* Use `rimraf` instead of `fs.rm`

* Fix properties order of `options`

* Install `find-cache-dir` and types

* Change default cache file location to `node_modules/.cache/prettier`

* Fix tests following to change default cache file location

* Update snapshots for changing default cache file location

* Set `os.tmpdir()` as a fallback for default cache dir

* Add docs for `--cache` and `--cache-location`

* Use `sdbm` instead of `node:crypto`

* Add changelog

* Fix `getHashOfOptions`

* Remove `cache-location`

* `prettiercache` -> `prettier-cache`

* Remove cache file when run Prettier without `--cache` option

* Implement `--cache-strategy`

* Add tests for invalid cache strategy

* Fix lint problems

* Tweaks tests

* Add tests for timestamp

* Add tests for `--cache-strategy`

* Add docs for cache-strategy

* Address review

* Fix `findCacheFile`

* Use Set.prototype.has

* Throw error with --stdin-filepath

* Update snapshots

* Fix error for cache and stdin

* Use string constructor instead of toString

* Update changelog

* Use flag validation

* Fix `cache-strategy` definition

* Update docs

* Mark highlihgt

* Throw error for `--cache-strategy` without `--cache`

* Update docs

* Fix typo

* Updates snapshots

* Update docs/cli.md

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>

* Fix error message

* Remove `:::` syntax

* Defaults `content`

* Update docs

* Fix by Prettier

Co-authored-by: Simon Lydell <simon.lydell@gmail.com>
2022-06-11 23:32:32 +09:00
Sosuke Suzuki 97bab8f984 Update angular-estree-parser (#12993)
* Update `angular-estree-parser`

* Add tests

* Add changelog
2022-06-11 20:08:46 +09:00
Sosuke Suzuki 7f9a08762d Update dependency flow-parser to v0.180.0 (#12990)
* Update `flow-parser`

* Update snapshots
2022-06-11 00:06:22 +09:00
Sosuke Suzuki be9d63e543 Avoid printing attribute per line in Vue SFC blocks (#12895)
* Avoid print single attribute perline for Vue SFC blocks

* Add tests

* Add changelog

* Fix typo

* Add more tests
2022-06-04 23:25:27 +09:00
Sosuke Suzuki a808df643d Update @typescript-eslint/typescript-estree to 5.27.0 and move tests (#12959)
* Install latest typescript-estree

* Move tests for type parameter of typeof

* Update changelog
2022-06-01 06:47:51 +09:00
Sosuke Suzuki 9c11aa141a Add tests for TS 4.7 features (#12924)
* Add tests for instantiation expressions

* Add tests for infer extends

* Add tests for optional variance

* Update changelog
2022-05-28 03:37:30 +09:00
Sosuke Suzuki 3147244f55 Update dependencies to support TypeScript 4.7 (#12921)
* Update `@typescript-eslint/typescript-estree` to 5.26.0

* Update `typescript` to `4.7.1-rc`

* Fix syntax kind

* Add `jsdoc_only_types.ts` to unstable tests

* Make printing jsdoc type stable

* Update typescript
2022-05-27 01:46:31 +09:00
Sosuke Suzuki 5b113e71b1 Add changelog for TypeScript 4.7 (#12901) 2022-05-22 03:33:18 +09:00
Sosuke Suzuki 2fc6e5dd4f Support TS 4.7 optional variance (#12900)
* Print `in` and `out`

* Add tests

* Add tests for jsx
2022-05-22 03:33:05 +09:00
Sosuke Suzuki 1eecc85985 Support TS 4.7 instantiation expression (#12898)
* Handle `TSInstantiationExpression`

* Print `typeParameters` for `TSTypeQuery`

* Add tests

* Add more tests
2022-05-22 03:30:47 +09:00