This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v2
->v3
v2
->v3
v1
->v3
v2
->v3
^2.5.0
->^3.0.0
v2.0.1
->v3.0.0
^2.5.1
->^3.0.0
^2.0.5
->^3.0.0
Release Notes
actions/cache (actions/cache)
v3
Compare Source
actions/checkout (actions/checkout)
v3
Compare Source
actions/setup-node (actions/setup-node)
v3
Compare Source
v2
Compare Source
import-js/eslint-import-resolver-typescript (eslint-import-resolver-typescript)
v3.6.1
Compare Source
Patch Changes
cf5d67f
Thanks @klippx! - Fix CJS import to make it compatible with ESM projectsv3.6.0
Compare Source
Minor Changes
b5ea367
Thanks @SukkaW! - refactor: dropglobby
andsynckit
v3.5.5
Compare Source
Patch Changes
84b0649
Thanks @JounQin! - fix: mark eslint-module-utils as depv3.5.4
Compare Source
Patch Changes
25f3920
Thanks @JounQin! - fix: enhanced-resolve is commonjs only - close #213#219
0bf6ffb
Thanks @lsmurray! - fix: check if cwd changed to bust mapper cachev3.5.3
Compare Source
Patch Changes
6531bad
Thanks @marvinhagemeister! - Only try to resolve a module directory when we know that the path is a directory. This can lead to a 15% speedup on projects with many files.v3.5.2
Compare Source
Patch Changes
#193
8756a26
Thanks @Rialgar! - chore(package): remove node 12 from engines field#187
7a91daf
Thanks @scott-ut! - fix: resolve modules if folder contains a package.json filev3.5.1
Compare Source
Patch Changes
afeb928
Thanks @chenxinyanc! - perf: disablethrowIfNoEntry
on Node 14+v3.5.0
Compare Source
Minor Changes
66a3e6c
Thanks @JounQin! - feat: reuseeslint-module-utils/hash.js
for better cachingPatch Changes
00abb6f
Thanks @JounQin! - fix: incorrect exports mappingv3.4.2
Compare Source
Patch Changes
594df9c
Thanks @HanSeo0507! - chore(deps): update dependency synckit to ^0.8.3 for yarn PnP (#169)v3.4.1
Compare Source
Patch Changes
8892a8c
Thanks @thatsmydoing! - perf: add filesystem caching supportv3.4.0
Compare Source
Minor Changes
82d090b
Thanks @rbong! - feat: add support forjsconfig.json
v3.3.0
Compare Source
Minor Changes
#154
42f2dd6
Thanks @JounQin! - feat: addexternsionAlias
option support,.d.([cm]?ts|tsx)
are always preferred than.([cm]?js|jsx)
typescript
resolvestypescript/lib/typescript.d.ts
instead oftypescript/lib/typescript.js
by default#154
42f2dd6
Thanks @JounQin! - feat: exportsglobSync
,defaultExtensions
,defaultMainFields
,defaultConditionNames
anddefaultExtensionAlias
for reusingPatch Changes
#154
42f2dd6
Thanks @JounQin! - perf: cacheoptions
andresolver
#154
42f2dd6
Thanks @JounQin! - chore: align with Angular Package Format correctlyreference: https://angular.io/guide/angular-package-format
#156
4bd60c3
Thanks @JounQin! - docs: document options fromenhanced-resolve
v3.2.7
Compare Source
Patch Changes
60ff431
Thanks @JounQin! - chore: bump synckitv3.2.6
Compare Source
Patch Changes
7edb823
Thanks @JounQin! - chore: use latestget-tsconfig
packagev3.2.5
Compare Source
Patch Changes
abf8907
Thanks @JounQin! - build: use pnpm as manager, yarn pnp is still supportedv3.2.4
Compare Source
Patch Changes
3e93659
Thanks @JounQin! - fix: run prerelease manually for yarn v3, 2nd tryv3.2.2
Compare Source
Patch Changes
d944b26
Thanks @JounQin! - fix: use yarn v3 with PnP linker, close #130v3.2.1
Compare Source
Patch Changes
fb88af2
Thanks @JounQin! - fix: try index file with extensions automaticallyv3.2.0
Compare Source
Minor Changes
#128
56775b3
Thanks @JounQin! - refactor: support custom extensions on resolving#128
56775b3
Thanks @JounQin! - feat: try extensionless file by defaultv3.1.5
Compare Source
Patch Changes
9cf60cb
Thanks @JounQin! - fix: auto try extensionsv3.1.4
Compare Source
Patch Changes
f88a8c9
Thanks @JounQin! - refactor: use non-capturing groups for perfv3.1.3
Compare Source
Patch Changes
35d3022
Thanks @JounQin! - fix: try index.d.ts automaticallyv3.1.2
Compare Source
Patch Changes
01f525e
Thanks @JounQin! - docs: update repository, documentexports
support3.1.1 (2022-06-27)
Bug Fixes
v3.1.1
Compare Source
v3.1.0
Compare Source
⚠ BREAKING CHANGES
Features
v3.0.0
Compare Source
⚠ BREAKING CHANGES
Features
bump globby, use synckit for sync fn (322cb29)
ignore
node_modules
folder inprojects
option glob (#105) (1e1b5a6)remove depracated directory option (67c8d59)
use get-tsconfig to replace tsconfig-paths (78a08e0)
deps: bump tsconfig-paths to ^4.0.0 (#104) (b2edbc8)
2.7.1 (2022-04-03)
Bug Fixes
pnpm/action-setup (pnpm/action-setup)
v3.0.0
Compare Source
v2.4.0
Compare Source
Add ability to install standalone binary (https://github.com/pnpm/action-setup/pull/92).
v2.3.0
Compare Source
package.json
file (https://github.com/pnpm/action-setup/pull/88).v2.2.4
Compare Source
No deprecation warnings are printed about set-state and set-output commands (https://github.com/pnpm/action-setup/issues/57)
v2.2.3
Compare Source
Bump Node.js version to 16 https://github.com/pnpm/action-setup/pull/56
v2.2.2
Compare Source
Fixing network issues.
Related issues:
Related PR:
v2.2.1
Compare Source
Fix
"packageManager"
reader https://github.com/pnpm/action-setup/pull/35v2.2.0
Compare Source
packageManager
field in thepackage.json
file https://github.com/pnpm/action-setup/pull/33.@pnpm/fetch
as an attempt to fix https://github.com/pnpm/action-setup/issues/22 https://github.com/pnpm/action-setup/pull/32.v2.1.0
Compare Source
Support pnpm v7 https://github.com/pnpm/action-setup/pull/29
prettier/prettier (prettier)
v3.2.5
Compare Source
diff
Support Angular inline styles as single template literal (#15968 by @sosukesuzuki)
Angular v17 supports single string inline styles.
Unexpected embedded formatting for Angular template (#15969 by @JounQin)
Computed template should not be considered as Angular component template
Use
"json"
parser fortsconfig.json
by default (#16012 by @sosukesuzuki)In v2.3.0, we introduced
"jsonc"
parser which adds trialing comma by default.When adding a new parser we also define how it will be used based on the
linguist-languages
data.tsconfig.json
is a special file used by TypeScript, it uses.json
file extension, but it actually uses the JSON with Comments syntax. However, we found that there are many third-party tools not recognize it correctly because of the confusing.json
file extension.We decide to treat it as a JSON file for now to avoid the extra configuration step.
To keep using the
"jsonc"
parser for yourtsconfig.json
files, add the following to your.pretterrc
filev3.2.4
Compare Source
diff
Fix incorrect parser inference (#15947 by @fisker)
Files like
.eslintrc.json
were incorrectly formatted as JSONC files.v3.2.3
Compare Source
diff
Throw errors for invalid code (#15881 by @fisker, @Josh-Cena, @auvred)
Fix parser inference (#15927 by @fisker)
v3.2.2
Compare Source
diff
Fix crash when parsing template literal CSS in a JSX style tag using a spread attribute (#15896 by @eelco)
For example this code would crash before:
Fix formatting error on optional call expression and member chain (#15920 by @sosukesuzuki)
v3.2.1
Compare Source
diff
Fix formatting error on member chain (#15915 by @sosukesuzuki)
v3.2.0
Compare Source
diff
🔗 Release Notes
v3.1.1
Compare Source
diff
Fix config file search (#15363 by @fisker)
Previously, we start search for config files from the filePath as a directory, if it happened to be a directory and contains config file, it will be used by mistake.
Skip explicitly passed symbolic links with
--no-error-on-unmatched-pattern
(#15533 by @sanmai-NL)Since Prettier v3, we stopped following symbolic links, however in some use cases, the symbolic link patterns can't be filtered out, and there is no way to prevent Prettier from throwing errors.
In Prettier 3.1.1, you can use
--no-error-on-unmatched-pattern
to simply skip symbolic links.Consistently use tabs in ternaries when
useTabs
istrue
(#15662 by @auvred)Improve config file search (#15663 by @fisker)
The Prettier config file search performance has been improved by more effective cache strategy.
Fix unstable and ugly formatting for comments in destructuring patterns (#15708 by @sosukesuzuki)
Support "Import Attributes" (#15718 by @fisker)
TypeScript 5.3 supports the latest updates to the import attributes proposal.
Fix false claim in docs that cursorOffset is incompatible with rangeStart/rangeEnd (#15750 by @ExplodingCabbage)
The cursorOffset option has in fact been compatible with rangeStart/rangeEnd for over 5 years, thanks to work by @ds300. However, Prettier's documentation (including the CLI
--help
text) continued to claim otherwise, falsely. The documentation is now fixed.Keep curly braces and
from
keyword in emptyimport
statements (#15756 by @fisker)Keep empty import attributes and assertions (#15757 by @fisker)
v3.1.0
Compare Source
diff
🔗 Release Notes
v3.0.3
Compare Source
diff
Add
preferUnplugged: true
topackage.json
(#15169 by @fisker and @so1ve)Prettier v3 uses dynamic imports, user will need to unplug Prettier when Yarn's PnP mode is enabled, add
preferUnplugged: true
topackage.json
, so Yarn will install Prettier as unplug by default.Support shared config that forbids
require()
(#15233 by @fisker)If an external shared config package is used, and the package
exports
don't haverequire
ordefault
export.In Prettier 3.0.2 Prettier fails when attempt to
require()
the package, and throws an error.Allow argument of
require()
to break (#15256 by @fisker)Do not print trailing commas in arrow function type parameter lists in
ts
code blocks (#15286 by @sosukesuzuki)Support TypeScript 5.2
using
/await using
declaration (#15321 by @sosukesuzuki)Support for the upcoming Explicit Resource Management feature in ECMAScript.
using
/await using
declarationv3.0.2
Compare Source
diff
Break after
=
of assignment if RHS is poorly breakable AwaitExpression or YieldExpression (#15204 by @seiyab)Do not add trailing comma for grouped scss comments (#15217 by @auvred)
Print
declare
andexport
keywords for nested namespace (#15249 by @sosukesuzuki)v3.0.1
Compare Source
diff
Fix cursor positioning for a special case (#14812 by @fisker)
Fix plugins/estree.d.ts to make it a module (#15018 by @kingyue737)
Add
export {}
inplugins/estree.d.ts
to fix the "File is not a module" errorAdd parenthesis around leading multiline comment in return statement (#15037 by @auvred)
Add support for Vue "Generic Components" (#15066 by @auvred)
https://blog.vuejs.org/posts/vue-3-3#generic-components
Fix comments print in
IfStatement
(#15076 by @fisker)Add missing type definition for
printer.preprocess
(#15123 by @so1ve)Add missing
getVisitorKeys
method type definition forPrinter
(#15125 by @auvred)Add typing to support
readonly
array properties of AST Node (#15127 by @auvred)Add space before unary minus followed by a function call (#15129 by @pamelalozano)
v3.0.0
Compare Source
diff
🔗 Release Notes
v2.8.8
Compare Source
This version is a republished version of v2.8.7.
A bad version was accidentally published and it can't be unpublished, apologies for the churn.
v2.8.7
Compare Source
diff
Allow multiple decorators on same getter/setter (#14584 by @fisker)
v2.8.6
Compare Source
diff
Allow decorators on private members and class expressions (#14548 by @fisker)
v2.8.5
Compare Source
diff
Support TypeScript 5.0 (#14391 by @fisker, #13819 by @fisker, @sosukesuzuki)
TypeScript 5.0 introduces two new syntactic features:
const
modifiers for type parametersexport type *
declarationsAdd missing parentheses for decorator (#14393 by @fisker)
Add parentheses for
TypeofTypeAnnotation
to improve readability (#14458 by @fisker)Support
max_line_length=off
when parsing.editorconfig
(#14516 by @josephfrazier)If an .editorconfig file is in your project and it sets
max_line_length=off
for the file you're formatting,it will be interpreted as a
printWidth
ofInfinity
rather than being ignored(which previously resulted in the default
printWidth
of 80 being applied, if not overridden by Prettier-specific configuration).v2.8.4
Compare Source
diff
Fix leading comments in mapped types with
readonly
(#13427 by @thorn0, @sosukesuzuki)Group params in opening block statements (#14067 by @jamescdavis)
This is a follow-up to #13930 to establish wrapping consistency between opening block statements and else blocks by
grouping params in opening blocks. This causes params to break to a new line together and not be split across lines
unless the length of params exceeds the print width. This also updates the else block wrapping to behave exactly the
same as opening blocks.
Ignore files in
.sl/
(#14206 by @bolinfest)In Sapling SCM,
.sl/
is the folder where it stores its state, analogous to.git/
in Git. It should be ignored in Prettier like the other SCM folders.Recognize
@satisfies
in Closure-style type casts (#14262 by @fisker)