putout

🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter with built-in ESLint and Babel support for js, jsx typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏

MIT License

Downloads
3.6M
Stars
646
Committers
23

Bot releases are visible (Hide)

putout - putout v34.2.0

Published by coderaiser 10 months ago

🐞 fix

  • 679e5055c @putout/plugin-remove-duplicate-keys: exclude ObjectPattern

πŸ”₯ feature

  • 6fe121997 putout: @putout/plugin-remove-useless-escape v5.0.0
  • 2d104e9cc @putout/plugin-remove-useless-escape: drop support of node < 18
  • eee4e215e @putout/plugin-remove-useless-escape: \" -> "
  • 33b8a39aa @putout/operator-filesystem: findFile: handle case when no file passed
  • cfa7c3f90 @putout/plugin-filesystem: replace-cwd: add
  • afaf038a9 @putout/plugin-nextjs: drop support of node < 18
  • 79ebcd60e @putout/plugin-next: Traverser -> Scanner
  • d7c811abc @putout/plugin-putout: convert-traverse-to-scan: add support of FS
putout - putout v34.1.1

Published by coderaiser 10 months ago

🐞 fix

  • 33880ca44 ignores: rm unused export
putout - putout v34.1.0

Published by coderaiser 10 months ago

🐞 fix

  • 33a899efb @putout/plugin-nodejs: disable convert-mjs-to-js

πŸ”₯ feature

  • 071e46a10 putout: @putout/plugin-remove-duplicate-keys v4.0.0
  • 71c7f5296 putout: add progress
  • d1dbf802c @putout/plugin-remove-duplicate-keys: drop support of node < 18
  • 447da2448 @putout/plugin-remove-duplicate-keys: improve support
  • 2205df2da @putout/operate: traverseProperties: extract
  • 09f3035d6 @putout/operate: traverseProperties: exclude SpreadElement
  • 18ad54613 @putout/operate: traverseProperties: firstLevel
  • 1f31aca61 @putout/operate: getProperties: SpreadElement
  • c24c98f0b @putout/engine-runner: progress
putout - putout v34.0.10

Published by coderaiser 10 months ago

πŸ”₯ feature

  • 20debfa7a putout: @putout/plugin-putout v18.0.0
  • f6508a0dc @putout/plugin-putout: drop support of 🐊 < 34
  • ea81da134 @putout/plugin-putout: apply-short-processors: number used as ObjectProperty value
putout - putout v34.0.9

Published by coderaiser 10 months ago

🐞 fix

  • fe888d8b0 putout: merge: nested
putout - putout v34.0.8

Published by coderaiser 10 months ago

🐞 fix

  • 55153c19d putout: merge: rules options

πŸ”₯ feature

  • 7c645f911 eslint-plugin-putout: markdown: disable config override
putout - putout v34.0.7

Published by coderaiser 10 months ago

🐞 fix

  • 4f577843a @putout/plugin-nodejs: ImportExpression

πŸ”₯ feature

  • c104af997 putout: @putout/plugin-remove-unused-variables v8.0.0
  • 23615c14d @putout/plugin-remove-unused-variables: drop support of node < 18
  • e064b4056 @putout/plugin-remove-unused-variables: ImportExpression
  • 55af3c51e @putout/plugin-nodejs: remove-strict-mode: top-level-await
  • 60dc7090a putout: @putout/plugin-promises v14.0.0
  • 70feedd63 @putout/plugin-promises: drop support of node < 18
  • 4cf3feef6 @putout/plugin-promises: remove-useless-await: ImportExpressions
  • 8fb758559 @putout/plugin-convert-assert-to-with: drop support of 🐊 < 34
  • a8b89d3c8 @putout/plugin-nodejs: ImportExpression
  • 549cc81da @putout/engine-parser: estree-to-babel v9.0.0
putout - putout v34.0.6

Published by coderaiser 10 months ago

πŸ”₯ feature

  • bb643d679 @putout/engine-runner: @putout/operate v12.0.0
  • c2178f703 @putout/compare: @putout/operate v12.0.0
  • 3928fadf3 @putout/operator-declare: @putout/operate v12.0.0
  • c10e380ba @putout/plugin-filesystem: @putout/operate v12.0.0
  • 6cfaefbe7 @putout/operator-filesystem: @putout/operate v12.0.0
  • 592612232 putout: @putout/operate v12.0.0
  • 38b607c05 @putout/operate: drop support of node < 18
  • 67b676130 putout: @putout/formatter-codeframe v6.0.0
  • 860e1075c @putout/codeframe: drop support of node < 18
  • 0f7cebf5a putout: @putout/babel v2
putout - putout v34.0.5

Published by coderaiser 10 months ago

πŸ”₯ feature

  • e2d6f36b0 putout: @putout/formatter-time v2.0.0
  • 527548a88 @putout/formatter-time: drop support of node < 18
putout - putout v34.0.4

Published by coderaiser 10 months ago

πŸ”₯ feature

  • 8b2470a8d putout: runner: worker: report: rm useless arg: report
  • 9b87f575c @putout/engine-processor: rm useless rawSource
putout - putout v34.0.3

Published by coderaiser 10 months ago

🐞 fix

  • 6538c3840 putout: loader: convert Buffer to string before transfrom
putout - putout v34.0.2

Published by coderaiser 10 months ago

πŸ”₯ feature

  • 8dc1419e7 putout: @putout/plugin-tape v13.0.0
  • 08a6d22ed putout: loader: node v18 support
  • 649f93cab @putout/plugin-tape: drop support of node < 18
  • a9c79f088 @putout/plugin-tape: convert-equal-to-deep-equal: add support of Buffer.from
putout - putout v34.0.1

Published by coderaiser 11 months ago

πŸ”₯ feature

  • f7e47b98c @putout/plugin-filesystem: convert-simple-filesystem-to-filesystem: no root
  • db826f521 root: supertape v9.0.0
  • 5d701db17 @putout/engine-runner: @putout/plugin-filesystem v3.0.0
  • c2565294b @putout/operator-match-files: @putout/operator-filesystem v3.0.0
  • cb0f7c440 putout: @putout/processor-filesystem v3.0.0
  • 7dce3aca7 @putout/processor-filesystem: drop support of node < 18
  • ba8151007 @putout/processor-filesystem: @putout/operator-filesystem v3.0.0
  • 18de89088 putout: @putout/plugin-filesystem v3.0.0
  • 4000aefb7 @putout/plugin-filesystem: drop support of node < 18
  • 503ddaa8e root: redlint v2.0.0
  • 855e32271 putout: @putout/engine-processor v11.0.0
  • c7cda4be7 @putout/engine-processor: @putout/engine-loader v13.0.0
  • 4e59d193b @putout/engine-runner: @putout/operator-filesystem v3.0.0
  • 2427fbc6c @putout/engine-runner: @putout/operator-declare v9.0.0
  • 7a4b94335 @putout/processor-typescript: drop support of node < 18
  • 452aab285 @putout/test v9
  • 4974fa08f supertape v9
  • 6ed9a72c7 @putout/processor-typescript: ts-morph v21.0.1
  • 1bc93231f putout: @putout/traverse v10.0.0
  • a53f71372 @putout/traverse: @putout/compare v14.0.0
  • fada9498c putout: @putout/operator-add-args v8.0.0
  • a3bc047c0 @putout/operator-add-args: @putout/engine-parser v10.0.2
  • 79bd83024 @putout/operator-add-args: @putout/compare v14.0.0
  • 119e1aea4 putout: @putout/operator-declare v9.0.0
  • aae106ce5 @putout/operator-declare: @putout/compare v14.0.0
  • 531cd0ee0 @putout/operator-declare: @putout/engine-parser v10.0.2
  • 895195844 putout: @putout/operator-filesystem v3.0.0
  • 749eccec5 @putout/operator-filesystem: drop supprot of node < 18
  • a44a2b2e7 @putout/operator-filesystem: @putout/engine-parser v10.0.2
  • d2a858a81 putout: @putout/operator-match-files v2.0.0
  • d228ab9f6 @putout/operator-match-files: drop support of node < 18
  • 01c9f1bb0 @putout/operator-match-files: @putout/engine-parser v10.0.2
  • 690d79b59 root: eslint-plugin-putout v22.0.0
  • f6e174fa8 @putout/engine-parser: @putout/printer v7.0.0
  • b7dc22537 eslint-plugin-putout: @putout/engine-parser v10.0.0
  • 7e5e6484f eslint-plugin-putout: drop support of node < 18
  • 289484295 putout: @putout/engine-runner v20.0.1
  • b07ce3330 @putout/engine-runner: @putout/compare v14.0.0
  • 8fc516c98 @putout/engine-runner: drop support of node < 18
  • 70c64d288 @putout/engine-runner: @putout/engine-parser v10.0.0
  • db59abcee putout: @putout/engine-loader v13.0.0
  • 250d4065f @putout/engine-loader: @putout/engine-parser v10.0.0
  • 6cc48341a @putout/engine-loader: drop support of node < 18
  • 0b137fc45 putout: @putout/compare v14.0.0
  • bf7c384be putout: @putout/engine-parser v10.0.0
  • a660029ee @putout/compare: @putout/engine-parser v10.0.0
  • dc4e2e959 @putout/compare: drop support of node < 18
  • 9b9eb15e9 @putout/engine-parser: drop support of node < 18
  • 1a8c94d7f @putout/engine-parser: @putout/printer v6.17.0
  • 01159751b root: madrun v10.0.0
putout - 🐊Putout v34

Published by coderaiser 11 months ago

image

The moment you know your real being, you are afraid of nothing. Death gives freedom and power. To be free in the world, you must die to the world. Then the universe is your own, it becomes your body, an expression and a tool. The happiness of being absolutely free is beyond description.

Sri Nisargadatta Maharaj

Hi folks! The time is come for the next big 🐊Putout release πŸŽ‰! Next version has a couple breaking changes, to the point!

⛔️ Drop support of node < 16

The time is come to drop support of deprecated versions of Node, that is not supported, so no new features and security fixes.
From now if you want to use 🐊Putout as loader run:

node --import putout/register hello.js

Merged @putout/plugin-strict-mode with @putout/plugin-nodejs

Strict Mode makes several changes to normal JavaScript semantics:

  • Eliminates some JavaScript silent errors by changing them to throw errors.
  • Fixes mistakes that make it difficult for JavaScript engines to perform optimizations: strict mode code can sometimes be made to run faster than identical code that's not strict mode.
  • Prohibits some syntax likely to be defined in future versions of ECMAScript.

(c) MDN

CommonJS is a module system supported in Node, it provides a require function, which can be used to access the exports object exposed by another file.

(c) parceljs

EcmaScript module syntax is the standard way to import and export values between files in JavaScript. The import statement can be used to reference a value exposed by the export statement in another file.

(c) parceljs

Strict Mode is useful for CommonJS which is default Module System of node.js. It is supported by Deno and Bun only for compatibility reason, since EcmaScript Modules uses Strict Mode by default. So one dependency less 😏.

Bun

⛔️ Stylelint updated to v16

Stylelint deprecated all rules related to formatting, and now Prettier used for this purpose, also it dropped support of node < 18.

πŸ”₯ Scanner

image

There is a new plugin type Scanner. When you want create a new file hello.txt :

[
    "/",
   ["/hello.txt", "hello world"]
]

Here is how it looks like:

module.exports.report = () => 'Create file hello.txt';

module.exports.fix = (rootPath) => {
    createFile(rootPath, 'hello.txt', 'hello world');
};

module.exports.scan = (rootPath) => {
    const [filePath] = findFile(rootPath, 'hello.txt');
    
    if (filePath)
        return null;
    
    return rootPath;
};

Now you can use simplified format of Filesystem:

__putout_processor_filesystem([
    '/',
    '/hello.txt',
    [
        '/world.txt',
        'hello world',
    ],
    '/abc/',
]);

Which is the same as:

__putout_processor_filesystem({
    type: 'directory',
    filename: '/',
    files: [{
        type: 'file',
        filename: '/hello.txt',
    }, {
        type: 'file',
        filename: '/world.txt',
        content: 'hello world',
    }, {
        type: 'directory',
        filename: '/abc',
        files: [],
    }],
});

With help of two new rules:

πŸ’ͺ Filesystem became more powerful

@putout/operator-filesystem became more mature 😏!

There is a couple new rules in @putout/plugin-nodejs, that is disabled by default, but they will work when you run:

npx redlint && putout .filesystem.json

It will generate .filesystem.json and applies next rules.

nodejs/rename-file-cjs-to-js

Rename *.cjs files when module !== "module":

 /
 |-- package.json
 `-- lib/
-     `-- hello.cjs
+     `-- hello.js

Check out in 🐊Putout Editor.

nodejs/rename-file-mjs-to-js

Rename *.mjs files when module === "module":

 /
 |-- package.json
 `-- lib/
-     `-- hello.mjs
+     `-- hello.js

You can even create css bundle 😏!

That's all for now folks, have a nice day 🎈!

🐞 fix

  • a022aac56 @putout/operate: traverseProperties: no parentPath
  • b582686dd @putout/plugin-filesystem: bundle-css: nested
  • d2330890f @putout/plugin-filesystem: bundle-css: no 1:1

πŸ”₯ feature

  • 949aebe7f putout: @putout/plugin-github v11.0.0
  • 141513a35 @putout/plugin-github: drop support of node < 18
  • 39b09238b putout: drop support of node < 18
  • e4cba8ca2 putout: @putout/plugin-nodejs v10.0.0
  • 398a7705d @putout/plugin-nodejs: drop support of node < 18
  • 90bce30f5 @putout/processor-css: return empty code when errors
  • 607373140 @putout/plugin-nodejs: merge strict-mode
  • 1de36b776 putout: @putout/processor-css v8.0.0
  • d990d9f9f @putout/processor: config:
  • d93b07a63 @putout/processor-css: drop support of node < 18
  • 835847d6f @putout/engine-parser: hermes-parser v0.18.0
  • 5976bcafb @putout/processor-css: cosmiconfig v9.0.0
  • ab83bf20f @putout/processor-css: stylelint-config-standard v35.0.0
  • 4efe55568 @putout/processor-css: stylelint v16.0.1
  • 72b0b1b7b @putout/processor-yaml: remove useless @putout/processor-json
  • f2ceb7f58 eslint-plugin-putout: safe: disable remove-useless-variables: declaration
  • af37d387f eslint-plugin-putout: remove-empty-newline-after-import: is-ubuiltin
  • b5a80dddf @putout/plugin-filesystem: bundle-css: errors
  • 76f7f80fa @putout/cli-filesystem: createDirectory: recursive
putout - putout v33.13.4

Published by coderaiser 11 months ago

🐞 fix

  • 24080a56c @putout/plugin-strict-mode: add-missing: await
  • e481fa3d3 @putout/operator-filesystem: writeFileContent: content
  • 2186a8e32 @putout/plugin-filesystem: bundle-css: minify -> t

πŸ”₯ feature

  • 2d2545386 putout: @putout/plugin-strict-mode v10.0.0
  • 4aa6a89f8 @putout/plugin-strict-mode: drop support of 🐊 < 33
  • 75bb838a1 @putout/plugin-strict-mode: add-missing: improve support of CommonJS
  • 6de5d62ba @putout/plugin-filesystem: bundle-css: concreate-files: add
  • 92b5d048d @putout/plugin-filesystem: bundle-css: add
  • 46e2ad15d @putout/test: transformWithOptions: UPDATE
  • 48eead652 @putout/plugin-putout: declare: operator-filesystem: createFile
  • ee78d2dd7 @putout/plugin-minify: mangle-names: undeclared (putoutjs/minify#6)
  • 392cd022d @putout/plugin-minify: mange-names: speed up
  • 01f597f6e @putout/plugin-minify: mangle-names: simplify
  • 8a4c54910 @putout/plugin-minify: mangle-names: couple args overlap (putoutjs/minify#6)
  • 3e3fdf42c @putout/plugin-tape: apply-stub-operator: called with no args
  • 0dc5b75ee @putout/plugin-conditions: add-return: add
  • 61a7a3501 @putout/plugin-minify: drop support of 🐊 < 33
  • bdfbeb9cb @putout/plugin-minify: mangle-names: closure (putoutjs/minify#6)
  • 134b67a77 @putout/plugin-conditions: apply-consistent-blocks: add comments support
putout - putout v33.13.3

Published by coderaiser 11 months ago

πŸ”₯ feature

  • e7cce35ad putout: @putout/plugin-madrun v18.0.0
  • 7fad0bf2e @putout/plugin-madrun: drop support of 🐊 < 33
  • da236e291 @putout/plugin-madrun: remove-useless-string-conversion
putout - putout v33.13.2

Published by coderaiser 11 months ago

🐞 fix

  • 0bf206ec4 putout: parse-options: apply-module-type-rules: tape
putout - putout v33.13.1

Published by coderaiser 11 months ago

🐞 fix

  • 9ca8632f4 putout: config: drop useless: tape/convert-mock-require-to-mock-import: already disabled
  • 56ed4c7da @putout/plugin-filesystem: convert-filesystem-to-simple-filesystem: trailing slash

πŸ”₯ feature

  • 0411f1fbc @putout/plugin-putout: declare: get-rule: simplify
  • 204f7f249 @putout/plugin-putout: declare: getFileType: add
  • 7b5875357 @putout/operator-filesystem: getFileType: add
  • 154a21204 @putout/engine-runner: Scanner: Simple Filesystem
  • dfad2a2ae @putout/operator-filesystem: pause/start
  • 27c932d6a @putout/operator-filesystem: putout -> babel
  • b40e5e9fc @putout/plugin-filesystem: simple-filesystem: simplify
  • 1f4bb7b18 putout: @putout/plugin-filesystem v2.0.0
  • 6731eda00 @putout/plugin-filesystem: drop support of 🐊 < 33
  • 5776b3819 @putout/plugin-filesystem: toSimple, fromSimple: add
putout - putout v33.13.0

Published by coderaiser 11 months ago

🐞 fix

  • da125278b @putout/operator-filesystem: parse-simple-filesystem: trailing shash
  • 8cbedc657 @putout/operator-filesystem: moveFile: same
  • 585bb59b3 @putout/operator-filesystem: createFile: join
  • e87464158 @putout/operator-filesystem: createFile: join

πŸ”₯ feature

  • 676a2687e putout: @putout/plugin-putout v17.0.0
  • 68fae6973 @putout/plugin-putout: declare: getRule: change signature
  • 4a910e608 @putout/plugin-putout: convert-get-rule-to-require: add off
  • b79b2bf8b @putout/plugin-filesystem: convert-filesystem-to-simple-filesystem
  • 86e1d810d @putout/plugin-filesystem: convert-simple-filesystem-to-filesystem
  • 9fcd8f295 @putout/plugin-putout: convert-traverse-to-scan: add
  • 8f34dc802 @putout/test: add support of Scanner
  • 0c8bf2340 @putout/engine-loader: Scanner
  • 2fa621c7d @putout/engine-runner: Scanner
  • b361e7483 @putout/operator-filesystem: createFile: improve
  • 9e0da1f5f @putout/operator-file-system: getFile -> findFile
  • 8d18ffc52 @putout/operator-filesystem: createFile: add
  • e0e96aae5 @putout/operator-filesystem: simplify testing drastically
  • e5e08eea5 @putout/operator-filesystem: parseSimpleFilesystem
putout - putout v33.12.0

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 135e39656 putout: add ability to ignore missing files
  • f23f62af6 @putout/operator-filesystem: readFileContent/writeFileContent: emoji support
  • b3202c486 @putout/plugin-nodejs: rename-file-mjs-to-js: add
Package Rankings
Top 1.65% on Npmjs.org
Badges
Extracted from project README
NPM version Build Status Coverage Status DeepScan putout npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm