chore(repo): Update linting & formatting #5268
Merged
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:
0.17.3->0.17.4^19.3.0->^19.7.1^19.2.2->^19.7.1^3->^3.5.2^3.3.3->^3.5.2^0.2.4->^0.3.6Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
arethetypeswrong/arethetypeswrong.github.io (@arethetypeswrong/cli)
v0.17.4Patch Changes
f118862]conventional-changelog/commitlint (@commitlint/cli)
v19.7.1Compare Source
Note: Version bump only for package @commitlint/cli
v19.6.1Compare Source
Note: Version bump only for package @commitlint/cli
v19.6.0Compare Source
Note: Version bump only for package @commitlint/cli
v19.5.0Compare Source
Features
19.4.1 (2024-08-28)
Note: Version bump only for package @commitlint/cli
v19.4.1Compare Source
Note: Version bump only for package @commitlint/cli
v19.4.0Compare Source
Features
conventional-changelog/commitlint (@commitlint/config-conventional)
v19.7.1Compare Source
Note: Version bump only for package @commitlint/config-conventional
v19.6.0Compare Source
Note: Version bump only for package @commitlint/config-conventional
v19.5.0Compare Source
Note: Version bump only for package @commitlint/config-conventional
19.4.1 (2024-08-28)
Note: Version bump only for package @commitlint/config-conventional
19.2.2 (2024-04-14)
Note: Version bump only for package @commitlint/config-conventional
v19.4.1Compare Source
Note: Version bump only for package @commitlint/config-conventional
prettier/prettier (jest-snapshot-prettier)
v3.5.2Compare Source
diff
Remove
module-synccondition (#17156 by @fisker)In Prettier 3.5.0, we added
module-synccondition topackage.json, so thatrequire("prettier")can use ESM version, but turns out it doesn't work if CommonJS and ESM plugins both imports builtin plugins. To solve this problem, we decide simply remove themodule-synccondition, sorequire("prettier")will still use the CommonJS version, we'll revisit untilrequire(ESM)feature is more stable.v3.5.1Compare Source
diff
Fix CLI crash when cache for old version exists (#17100 by @sosukesuzuki)
Prettier 3.5 uses a different cache format than previous versions, Prettier 3.5.0 crashes when reading existing cache file, Prettier 3.5.1 fixed the problem.
Support dockercompose and github-actions-workflow in VSCode (#17101 by @remcohaszing)
Prettier now supports the
dockercomposeandgithub-actions-workflowlanguages in Visual Studio Code.v3.5.0Compare Source
diff
🔗 Release Notes
v3.4.2Compare Source
diff
Treat U+30A0 & U+30FB in Katakana Block as CJK (#16796 by @tats-u)
Prettier doesn't treat U+30A0 & U+30FB as Japanese. U+30FB is commonly used in Japanese to represent the delimitation of first and last names of non-Japanese people or “and”. The following “C言語・C++・Go・Rust” means “C language & C++ & Go & Rust” in Japanese.
U+30A0 can be used as the replacement of the
-in non-Japanese names (e.g. “Saint-Saëns” (Charles Camille Saint-Saëns) can be represented as “サン゠サーンス” in Japanese), but substituted by ASCII hyphen (U+002D) or U+FF1D (full width hyphen) in many cases (e.g. “サン=サーンス” or “サン=サーンス”).Fix comments print on class methods with decorators (#16891 by @fisker)
Fix non-idempotent formatting (#16899 by @seiyab)
This bug fix is not language-specific. You may see similar change in any languages. This fixes regression in 3.4.0 so change caused by it should yield same formatting as 3.3.3.
v3.4.1Compare Source
diff
Remove unnecessary parentheses around assignment in
v-on(#16887 by @fisker)v3.4.0Compare Source
diff
🔗 Release Notes
v3.3.3Compare Source
diff
Add parentheses for nullish coalescing in ternary (#16391 by @cdignam-segment)
This change adds clarity to operator precedence.
Add parentheses for decorator expressions (#16458 by @y-schneider)
Prevent parentheses around member expressions or tagged template literals from being removed to follow the stricter parsing rules of TypeScript 5.5.
Support
@letdeclaration syntax (#16474 by @sosukesuzuki)Adds support for Angular v18
@letdeclaration syntax.Please see the following code example. The
@letdeclaration allows you to define local variables within the template:For more details, please refer to the excellent blog post by the Angular Team: Introducing @let in Angular.
We also appreciate the Angular Team for kindly answering our questions to implement this feature.
v3.3.2Compare Source
diff
Fix handlebars path expressions starts with
@(#16358 by @Princeyadav05)v3.3.1Compare Source
diff
Preserve empty lines in front matter (#16347 by @fisker)
Preserve explicit language in front matter (#16348 by @fisker)
Avoid line breaks in import attributes (#16349 by @fisker)
v3.3.0Compare Source
diff
🔗 Release Notes
v3.2.5Compare 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.jsonby default (#16012 by @sosukesuzuki)In v3.2.0, we introduced
"jsonc"parser which adds trailing comma by default.When adding a new parser we also define how it will be used based on the
linguist-languagesdata.tsconfig.jsonis a special file used by TypeScript, it uses.jsonfile 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.jsonfile 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.jsonfiles, add the following to your.prettierrcfile{ "overrides": [ { "files": ["tsconfig.json", "jsconfig.json"], "options": { "parser": "jsonc" } } ] }v3.2.4Compare Source
prettier --file-info tsconfig.json
{ "ignored": false, "inferredParser": "jsonc" }
v3.2.3Compare Source
diff
Throw errors for invalid code (#15881 by @fisker, @Josh-Cena, @auvred)
Fix parser inference (#15927 by @fisker)
v3.2.2Compare 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.1Compare Source
diff
Fix formatting error on member chain (#15915 by @sosukesuzuki)
v3.2.0Compare Source
diff
🔗 Release Notes
v3.1.1Compare 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-patternto simply skip symbolic links.Consistently use tabs in ternaries when
useTabsistrue(#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
--helptext) continued to claim otherwise, falsely. The documentation is now fixed.Keep curly braces and
fromkeyword in emptyimportstatements (#15756 by @fisker)Keep empty import attributes and assertions (#15757 by @fisker)
v3.1.0Compare Source
diff
🔗 Release Notes
v3.0.3Compare Source
diff
Add
preferUnplugged: truetopackage.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: truetopackage.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
exportsdon't haverequireordefaultexport.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
tscode blocks (#15286 by @sosukesuzuki)Support TypeScript 5.2
using/await usingdeclaration (#15321 by @sosukesuzuki)Support for the upcoming Explicit Resource Management feature in ECMAScript.
using/await usingdeclarationv3.0.2Compare 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
declareandexportkeywords for nested namespace (#15249 by @sosukesuzuki)v3.0.1Compare 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.tsto 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)export interface Printer<T = any> { // ... + preprocess?: + | ((ast: T, options: ParserOptions<T>) => T | Promise<T>) + | undefined; }Add missing
getVisitorKeysmethod type definition forPrinter(#15125 by @auvred)Add typing to support
readonlyarray properties of AST Node (#15127 by @auvred)Add space before unary minus followed by a function call (#15129 by @pamelalozano)
publint/publint (publint)
v0.3.6Compare Source
Patch Changes
.jsor/index.js(04f289e)v0.3.5Compare Source
Patch Changes
Check the
"bin"field if the referenced file exists, has the correct JS format, and can be executed (#150)Deprecate the
depscommand. The command has been tricky to maintain and incomplete (e.g. doesn't lint recursively). A separate tool can be used to run publint on dependencies instead, e.g.npx renoma --filter-rules "publint". (#149)v0.3.4Compare Source
Patch Changes
When globbing
"exports"values that contains*, also respect"exports"keys that mark paths as null. For example: (b9605ae){ "exports": { "./*": "./dist/*", "./browser/*": null } }The glob in
"./*": "./dist/*"will no longer match and lint files in"./browser/*"as it's marked null (internal).Update logs when running the
publintCLI: (58d96a2)publintversion is now displayed.publint depscommand no longer logs passing dependencies. Only failing dependencies are logged.Examples:
$ npx publint deps $ Running publint v0.X.X for my-library deps... $ x my-dependency $ Errors: $ 1. ...Fix detecting shorthand repository URLs with the
.character (09d8cbb)Clarify message when
"types"is not the first condition in the"exports"field (5a6ba00)Correctly detect if a
"types"value in"exports"is used for dual publishing (3f3d8b2)v0.3.3Compare Source
Patch Changes
Rename
EXPORT_TYPES_INVALID_FORMATmessage toEXPORTS_TYPES_INVALID_FORMAT(#139)Allow versioned types conditions (e.g.
"types@>=5.2") in"exports"when checking for"types"condition ordering (#138)v0.3.2Compare Source
Patch Changes
(Potentially breaking) Disable running lifecycle scripts, such as
prepare,prepack, andpostpack, when running the pack command internally. This returns to the behavior in v0.2. (Note that this change does not apply to yarn as it does not support ignoring lifecycle scripts for local projects) (#128)This change is made as running lifecycle scripts was an unintentional behavior during the v0.3 breaking change, which could cause the linting process to take longer than expected, or even cause infinite loops if
publintis used in a lifecycle script.Update repository and bugs URLs to point to the new
publintorganization (1eda033)Updated dependencies [
1eda033,10e3891]:v0.3.1Compare Source
Patch Changes
packoption (#124)v0.3.0Compare Source
Minor Changes
The
vfsoption is removed in favour of an extended support ofpack: { tarball: ArrayBuffer | ReadableStream }andpack: { files: PackFile[] }APIs. Now, it is even easier to usepublintin the browser or against a packed.tgzfile in Node.js. See the docs for more examples of how to use these new options. (#122)Bump node version support to >=18 (
cb2ed8b)publintnow runs your project's package manager'spackcommand to get the list of packed files for linting. The previousnpm-packlistdependency is now removed. (#120)A new
packoption is added to the node API to allow configuring this. It defaults to'auto'and will automatically detect your project's package manager usingpackage-manager-detector. See its JSDoc for more information of the option.This change is made as package managers have different behaviors for packing files, so running their
packcommand directly allows for more accurate linting. However, as a result of executing these commands in a child process, it may take 200-500ms longer to lint depending on the package manager used and the project size. The new handling also does not support yarn 1. See this comment for more information.If you use yarn 1, you should upgrade to the latest yarn version or a different package manager. Otherwise, no other changes are required for this new behavior.
Patch Changes
Initial setup to publish with Changesets (
24a62f5)When a dependency with the
file:orlink:protocol is specified in thepackage.json, it will now error to prevent accidentally publishing dependencies that will likely not work when installed by end-users (6e6ab33)Fix
EXPORT_TYPES_INVALID_FORMATlinting to detect.d.mtsand.d.ctsfiles (af5e88b)Updated dependencies [
d0b406b]:v0.2.12Compare Source
Features
"license"field is not set inpackage.json, a suggestion will now be shown to add the field (https://github.com/bluwy/publint/issues/111)Bug fixes
"repostory"field, string shorthands with nested paths likegitlab:org/user/repois now considered valid (https://github.com/bluwy/publint/issues/113)Site
Full Changelog: publint/publint@v0.2.11...v0.2.12
v0.2.11Compare Source
Features
formatMessage()utility with a newcoloroption to force enable or disable returning color in string (https://github.com/bluwy/publint/pull/110)New Contributors
Full Changelog: publint/publint@v0.2.10...v0.2.11
v0.2.10Compare Source
Features
"repository"field (https://github.com/bluwy/publint/pull/106)"repository"is a string, it must be one of the supported shorthand strings from the docs."repository"is an object with"type": "git", the"url"must be a valid git URL and can be parsed by npm.git://protocol for GitHub repos should not be used due security concerns.git+and postfixed with.git. (This is also warned by npm when publishing a package).New Contributors
Full Changelog: publint/publint@v0.2.9...v0.2.10
v0.2.9Compare Source
Bug fixes
New Contributors
Full Changelog: publint/publint@v0.2.8...v0.2.9
v0.2.8Compare Source
Bug fixes
Full Changelog: publint/publint@v0.2.7...v0.2.8
v0.2.7Compare Source
Features
"main"/"module"and"exports"fields, but the"exports"field doesn't export the root entrypoint, warn about the inconsistency. When"exports"is defined, it takes the highest priority, so all the library's entrypoint (root and deep) needs to be specified here. (https://github.com/bluwy/publint/issues/88)"type"field. In Node.js v20.10.0, it introduces a new--experimental-default-typeflag to flip the default module system from "CJS-as-default" to "ESM-as-default". It's recommended for libraries to specify the"type"field explicitly to prevent CJS files from being incorrectly interpreted as ESM. This suggestion helps push towards a better ESM experience in the future. (https://github.com/bluwy/publint/issues/83)Full Changelog: publint/publint@v0.2.6...v0.2.7
v0.2.6Compare Source
Features
jsnext:mainorjsnextfields are used by @sapphi-red (https://github.com/bluwy/publint/pull/85)Site
New Contributors
Full Changelog: publint/publint@v0.2.5...v0.2.6
v0.2.5Compare Source
Bug fixes
Configuration
📅 Schedule: Branch creation - "before 7am on the first day of the week" in timezone GMT, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.