Skip to content

putout v29.11.0

Choose a tag to compare

@coderaiser coderaiser released this 03 Jun 13:04
· 9124 commits to master since this release

New Exit Code

Just added new exit code CANNOT_LINT_STAGED:

image

Convert assert to with

This feature would ideally use the with keyword to denote attributes, but there are existing implementations based on a previous version of the proposal using the assert keyword. Due to potential web compatibility risks, the proposal still includes assert marked as deprecated. Usage of the old syntax is discouraged, and its removal is being investigated.

(c) tc39

The "import assertions" proposal's syntax changed to use the with keyword instead of assert, and it has also been renamed to "import attributes".

(c) Babel

Before:

import x1 from 'y' assert {type: 'json'};
import("foo.json", { assert: { type: "json" } });

After:

import x2 from 'y' with {type: 'json'};
import("foo.json", { with: { type: "json" } });

Checkout in 🐊Putout Editor.

New syntax is not support for now by node.js and chrome, they supports assertions anyways it will be useful in a future.

🔥 feature

  • dea4b68 putout: exit-codes: --staged: add CANNOT_LINT_STAGED
  • 31c597a @putout/engine-parser: babel plugins: add back support of assert in ImportDeclartations
  • a2e019a @putout/plugin-minify: mangle-names: get back old behaviour since it is more optimal
  • fd75353 @putout/plugin-minify: mangle-names: use index of scope instead of global counter
  • 885caad @putout/engine-parser: add support of import attributes (https://babeljs.io/blog/2023/05/26/7.22.0#import-attributes-15536-15620)
  • 8b3492f @putout/engine-parser: babel: plugins: remove enabled by default
  • 825f691 @putout/plugin-new: remove-useless: add TypeError
  • be9c83b @putout/plugin-minify: expand-bindings: keep only Identifiers
  • 3b3f6f9 @putout/plugin-minify: expand-variables: add
  • 550493d @putout/plugin-minify: convert-strict-equal-to-equal: add
  • 9150cce @putout/plugin-types: use @putout/printer
  • d29eb0b @putout/plugin-types: convert-typeof-to-is-type: improve support of node var binding
  • 47af1a2 @putout/plugin-minify: shorten-names: improve support of freeze, defineProperty
  • cc6f5f5 @putout/engine-runner: store: uplist: check node
  • 806d1a4 @putout/plugin-minify: shorten-name
  • 41dccd6 @putout/plugin-minify: shorten-names: improve support
  • 72990c0 @putout/plugin-minify: merge-variables: add
  • 0195c17 @putout/plugin-minify: convert-const-to-var: add
  • 9edb1d2 @putout/plugin-minify: shorten: add ability to check printed
  • ada9b57 @putout/plugin-minify: shorten-names: declared
  • b1ff899 @putout/plugin-minify: shorten names: add