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 hidden (Show)

putout - putout v33.11.0

Published by coderaiser 11 months ago

🐞 fix

  • cd7b4035d @putout/plugin-filesystem: move-referenced-file: report

πŸ”₯ feature

  • ea0761c0f @putout/operator-filesystem: readFileContent/writeFileContent: emoji support
  • a5004685f @putout/plugin-nodejs: rename-file-mjs-to-js: add
  • a3653b742 @putout/plugin-nodejs: rename-file-cjs-to-js: add
  • f957fe6a8 @putout/test: noReportAfterTransformWithOptions: add
  • fe6cdf4c5 @putout/operator-filesystem: copyFile/moveFile: overwrite
  • b59b533f2 @putout/plugin-putout: declare: copyFile: add
  • 4712fb82e @putout/cli-filesystem: copyFile: add
  • 528b36c9b @putout/operator-filesystem: copyFile/moveFile: overwrite
  • 95d2fe901 @putout/operator-filesystem: copyFile: add
putout - putout v33.10.0

Published by coderaiser 11 months ago

🐞 fix

  • 86be2a3bb @putout/plugin-filesystem: options

πŸ”₯ feature

  • 8a4ddc626 @putout/cli-filesystem: removeFile: recursive
  • 4a83bb83f putout: ignore: add ability to merge negated (kaelzhang/node-ignore#107)
  • 340736186 @putout/plugin-filesystem: remove-files: add
  • 725f8517e @putout/plugin-filesystem: move-referenced-file: add
  • fb3cd2399 @putout/plugin-putout: replace-test-message: improve report/noTransform handling
  • 1d5a722ab @putout/plugin-filesystem: rename-referenced-file: move renameFile to fix
  • a322f2582 @putout/plugin-filesystem: rename-referenced-file: add
putout - putout v33.9.2

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 3421c4a80 putout: @putout/plugin-remove-useless-escape v4.0.0
  • 6ac8df500 @putout/plugin-remove-useless-escape: drop support of 🐊 < 33
  • 975b22a09 @putout/plugin-remove-useless-escape: $, {
putout - putout v33.9.1

Published by coderaiser 11 months ago

πŸ”₯ feature

  • a9bd7f13b putout: @putout/plugin-convert-quotes-to-backticks v3.0.0
  • a66edf428 @putout/plugin-convert-quotes-to-backtics: drop support of 🐊 < 33
  • 1ea125b4c @putout/plugin-convert-quotes-to-backticks: exclude template variables
  • 290d901fc @putout/operator-filesystem: findFile: couple masks
  • d56d88fe1 @putout/plugin-filesystem: move out renameFileByMask
  • 5ec1f7a73 @putout/plugin-filesystem: rename-file: add mask
  • 60ac0ac18 @putout/operator-filesystem: renameFile: handle slashes
putout - putout v33.9.0

Published by coderaiser 11 months ago

🐞 fix

  • fc9f6ca66 @putout/plugin-filesystem: rename-test-to-spec: report
  • 3c62be182 @putout/operator-match-files: rm useless @putout/printer

πŸ”₯ feature

  • 9eff5bae8 @putout/plugin-filesystem: rename-test-to-spec: add
  • 4a3638d02 putout: filesystem: enable only for '.filesystem.json'
  • 7f1805247 @putout/plugin-filesystem: rename-spec-to-test: add
  • 55e5a2740 @putout/plugin-putout: declare: getFilename: add
  • 18a153ff1 @putout/plugin-putout: add-push: referenced
  • 1d9f638b2 @putout/plugin-putout: replace-test-message: transform: add support of no replace
putout - putout v33.8.1

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 970b3b33b putout: supported-files: fullstore
putout - putout v33.8.0

Published by coderaiser 11 months ago

🐞 fix

  • d79f6a49e putout: loader: use putoutAsync

πŸ”₯ feature

  • be92475be putout: enable nodejs filesystem rules
  • a8e501db1 @putout/plugin-nodejs: mjs-file: add
  • f85820fca @putout/plugin-nodejs: cjs-file: add
  • 4e80a6f73 @putout/operator-match-files: add additional check of provided files
  • be49cc530 @putout/operator-match-files: autodetect json/js
putout - putout v33.7.0

Published by coderaiser 11 months ago

🐞 fix

  • 0650c3c03 @putout/plugin-nextjs: update-tsconfig: disabled by default

πŸ”₯ feature

  • cd981e88c @putout/plugin-putout: declare: matchFiles: add
  • 3b577c59d @putout/operator-match-files: add
  • 2dff879d0 putout: exports: transform, findPlaces
  • c8be4d2d0 @putout/plugin-nextjs: update-tsconfig-file: reuse update-tsconfig-file
  • 80cd0b2a7 @putout/plugin-nextjs: update-tsconfig: add
  • f48b53485 @putout/plugin-nextjs: update-tsconfig-file: add
putout - putout v33.6.2

Published by coderaiser 11 months ago

🐞 fix

  • eae45513d @putout/operator-filesystem: writeFileContent: base64

πŸ”₯ feature

  • 70959a20b putout: @putout/plugin-eslint v6.0.0
  • 9841829ab @putout/plugin-eslint: drop support of 🐊 < 33
  • 6b06a327e @putout/operate: setLiteralValue: empty double quotes in raw
  • 7a5dfa11b @putout/operator-filesystem: use base64 inside readFileContent/writeFileContent
  • ad1a02449 @putotu/operator-filesystem: writeFileContent: field exists
putout - putout v33.6.1

Published by coderaiser 11 months ago

πŸ”₯ feature

  • efeb16707 putout: @putout/plugin-package-json v6.0.0
  • 0830df2ef @putout/plugin-package-json: drop support of 🐊 < 33
  • a5822f182 @putout/plugin-putout: apply-short-processors: add
putout - putout v33.6.0

Published by coderaiser 11 months ago

🐞 fix

  • 6333cf383 @putout/operator-json: drop peer dependency
  • f8ca7ae14 @putout/processor-filesystem: drop export isJSON

πŸ”₯ feature

  • 13a176492 putout: @putout/plugin-browserlist v2.0.0
  • e0d08155d @putout/plugin-browserlist: drop support of node < 16
  • 2f1caac15 putout: disable browserlist for all files except .browserlistrc
  • 73575facd putout: @putout/plugin-npmignore v3.0.0
  • 2652f7c12 @putout/plugin-npmignore: drop support of node < 16
  • 2489f243f @putotu/plugin-npmignore: use __array
  • 32402a01e @putout/plugin-travis: drop support of 🐊 < 33
  • 82d76f506 @putout/plugin-travis: use __yaml
  • 6f3ac9782 putout: @putout/processor-yaml v7.0.0
  • 36121ad89 putout: @putout/plugin-github v10.0.0
  • 31bdcb37f @putout/plugin-github: use __yaml
  • ecf96039c @putout/plugin-github: drop support of a🐊 < 33
  • 7fcd972d5 @putout/processor-yaml: json -> yaml
  • 51d293601 @putout/plugin-gitub: json -> yaml
  • 8179fd083 @putout/processor-json: is-json
  • 3bb33ecdf @putout/operator-json: export names
  • bf21d1bea @putout/operator-json: add isJSON
  • 3335cb91e putout: @putout/processor-ignore v5.0.0
  • 6c7cf6091 @putout/processor-ignore: use @putout/operator-json
  • e44e0e92c @putout/operator-json: __yaml, __ignore
  • 1d176923a putout: @putout/plugin-gitignore v4.0.0
  • 58b913421 @putout/plugin-gitignore: drop support of node < 16
  • 718439571 @putout/plugin-gitignore: use __ignore
  • c83b663a1 @putout/plugin-putout: declare: __ignore
  • bfcf68252 @putout/plugin-putout: declare: __yaml
putout - putout v33.5.0

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 17555f4cd @putout/declare: operator-json: toJS, fromJS, __json, __filesystem
  • d0e7670bf putout: @putout/processor-filesystem v2.0.0
  • 616286ce9 @putout/processor-filesystem: @putout/operator-filesystem v2.0.0
  • a9a39c1b5 putout: @putout/processor-json v8.0.0
  • 39cc05358 putout: @putout/processor-markdown v11.0.0
  • 4f9483162 putout: @putout/operator-filesystem v2.0.0
  • ed4b5db53 @putout/operator-filesystem: drop support of 🐊 < 33
  • d88b24cd6 @putout/operator-json: add
  • 77a0c1bd4 @putout/processor-ignore: simplify
  • 95143f13a @putout/procesor-filesystem: simplify
  • 438fefa7d @putout/processor-json: simplify
putout - putout v33.4.1

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 7fc18d0d1 putout: @putout/plugin-putout v16.0.0
  • 3d4b1c229 @putout/plugin-putout: drop support of 🐊 < 33
  • 1126d0be3 @putout/plugin-putout: declare: readFileContent, writeFileContent
putout - putout v33.4.0

Published by coderaiser 11 months ago

🐞 fix

  • e73bed76f @putout/plugin-nodejs: add-node-preget back native module
  • aad6a94dc @putout/plugin-nodejs: add-node-preadd is-builtin-module to get esm.sh working
  • d97ebfc58 @putout/plugin-nodejs: add-node-preprefix
  • f3a4f5e5b @putout/plugin-conditions: repository url

πŸ”₯ feature

  • 6cfce4c4c putout: @putout/plugin-remove-useless-return v6.0.0
  • 59c459244 @putout/plugin-remove-useless-return: drop support of 🐊 < 33
  • 984982c23 @putout/plugin-remove-useless-return: exclude complex params
  • 09f3abf4f @putout/cli-filesystem: readFileContent, writeFileContent
  • 17a34ada8 @putout/operator-filesystem: readFileContent, writeFileContent
putout - putout v33.3.0

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 2e5080fd2 putout: @putout/plugin-conditions v4.0.0
  • 5e4c149d8 @putout/plugin-conditions: drop support of 🐊 < 33
  • afda2e338 @putout/plugin-conditions: merge apply-consistent-blocks
  • 78b127500 @putout/plugin-apply-consistent-blocks: exclude if inside else
  • e286615e3 @putout/plugin-apply-consistent-blocks: add one more levels of nesting
  • b36ba4b97 @putout/plugin-apply-consistent-blocks: add
putout - putout v33.2.0

Published by coderaiser 11 months ago

πŸ”₯ feature

  • 5a7a26ff5 @putout/plugin-apply-consistent-blocks: add
  • afd7ab908 @putout/compare: __body: improve: no node check
putout - putout v33.1.1

Published by coderaiser 11 months ago

🐞 fix

  • 4b4cfb639 @putout/plugin-remove-empty: drop support of 🐊 < 33
  • e62f498b7 @putout/plugin-nextjs: create-app-directory: report

πŸ”₯ feature

  • b3c8f32e2 putout: @putout/plugin-remove-empty v11.0.0
  • 845380f3c putout: @putout/plugin-new v3.0.1
  • 35f362c51 @putout/plugin-new: drop suport of 🐊 < 33
putout - putout v33.1.0

Published by coderaiser 11 months ago

🐞 fix

  • 885441dce featur: @putout/plugin-nodejs: add-node-preuse module
  • f191e04f3 @putout/processor-filesystem: merge: a couple sources in list
  • 7bea61cd5 @putout/plugin-filesystem: findFile

πŸ”₯ feature

  • bb557e59e putout: @putout/cli-choose-formatter v2.0.0
  • c58ad0323 @putout/cli-choose-formatter: drop support of 🐊 < 33
  • 2f1b58124 @putout/cli-choose-formatter: keep options
  • 561d3745e @putout/plugin-nextjs: create-app-directory: add
  • 8bb263dc2 @putout/plugin-putout: declare: createDirectory, getParentDirectory
  • a2699b836 @putout/operator-filesystem: getParentDirectory: add
  • 79802be86 @putout/cli-filesystem: createDirectory: add
  • e2cf800c9 @putout/operator-filesystem: createDirectory: add
  • c7241c036 @putout/operator-filesystem: moveFile: improve
  • 80f20ab2e @putout/plugin-nextjs: drop support of 🐊 < 33
  • 8b4d71b3e @putout/plugin-nextjs: move-404-to-not-found: add
  • d88cd8dd3 @putout/plugin-putout: declare: operator: moveFile
  • 4fa2201fc @putout/operator-filesystem: moveFile: add
  • a07f64a6c @putout/processor-filesystem: merge: filter "__putout_processor_filesystem" first
  • 40f296267 @putout/plugin-filesystem: remove-vim-swap-file: add
  • 3b27bd74d @putout/operator-filesystem: findFile: add support of glob
  • ddc15035d @putout/cli-filesystem: removeFile
  • 8db4748ea @putout/plugin-putout: declare: removeFile
  • c35802c66 @putout/operator-filesystem: removeFile: add
putout - 🐊Putout v33

Published by coderaiser 12 months ago

image

The soul can never be cut into pieces by any weapon, nor can he be burned by fire, nor moistened by water, nor withered by the wind.

(c) Bhagavad Gita

Hi folks 🎈!
The time is come for a new major release. It has some interesting visual features, and a couple breaking changes related to rule names.

🎁 Formatter Time

image

That's right! Now you can see how much time is gone while you linting. Use:

putout . -f time

to use @putout/formatter-time as a formatter.

🎁Choose Formatter easily

With help of @putout/cli-choose-formatter using:

putout -i

you can choose the formatter you like for you next lint:

image

🎁 Filesystem Processor

There is a thing that was impossible to do in 🐊Putout until today: lint filesystem.
But everything is changed now! Lint file system is as simple as running redlint:

redlint

It generates file .filesystem.json:

{
    "type": "directory",
    "filename": "/home/coderaiser/putout",
    "files": [{
        "type": "file",
        "filename": "/home/coderaiser/putout/README.md",
    }, {
        "type": "directory",
        "filename": "/home/coderaiser/putout/lib",
        "files": [{
            "type": "file",
            "filename": "/home/coderaiser/putout/lib/putout.js",
        }]
     }]
}

Let's suppose you want to rename README.md to readme.md.
You can traverse AST-representation of a filesystem using findFile() and modify it using renameFile().
Here is how Replacer can look like:

const FS = '__putout_processor_filesystem(__object)';

export const report = () => `Rename 'README.md' to 'readme.md'`;

export const fix = (path) => {
    renameFile(path, 'readme.md');
};

export const traverse = () => ({
    [FS](path) {
        const [filePath] = findFiles(path, 'README.md');
        push(filePath);
    }
});

Here is modified AST-representation of a filesystem:

{
    "type": "directory",
    "filename": "/home/coderaiser/putout",
    "files": [{
        "type": "file",
        "filename": "/home/coderaiser/putout/readme.md"
    }, {
        "type": "directory",
        "filename": "/home/coderaiser/putout/lib",
        "files": [{
            "type": "file",
            "filename": "/home/coderaiser/putout/lib/putout.js"
        }]
    }]
}

When you run it from terminal - modifications will be applied to filesystem.
It is possible, thanks to:

So now you have ability to create rules with atomic updates to your filesystem, just in the browser using 🐊Putout Editor, πŸ“±Mobile Putout Editor, distribute it using npm and test it with @putout/test with no mocking at all 😏.

☝️ Checkout out in 🐊Putout Editor

A couple breaking changes have been made to simplify rules structure, and decrease dependencies count.

☒️convert-esm-to-commonjs and convert-commonjs-to-esm merged to @putout/plugin-nodejs

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.

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

This rules now disabled by default. That's right, now you can make Nested Plugin rules disabled, by default with help of:

const convert = require('./convert-commonjs-to-esm');

module.exports.rules = {
    'convert-commonjs-to-esm': ['off', convert];
}
{
    "rules": {
+    "convert-esm-to-commonjs": "on",
+    "convert-commonjs-to-esm": "on',
-    "nodejs/convert-esm-to-commonjs": "on",
-    "nodejs/convert-commonjs-to-esm": "on',
    }
}

☒️convert-mock-require-to-mock-import merged to @putout/plugin-tape

{
    "rules": {
-    "convert-mock-require-to-mock-import": "off",
+    "tape/mock-require-to-mock-import": "off",
    }
}

nodejs/convert-exports-to-module-exports

One new rule appeared (#191).

Since exports = 5 wan't make any export, just change value of variable. Checkout in 🐊Putout Editor.

❌ Example of incorrect code

exports.x = 5;

βœ… Example of correct code

module.exports.x = 5;

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

πŸ”₯ feature

  • d28219c92 @putout/engine-loader: rm unused isExluded
  • 6b2721dc1 putout: add ability to provide disabled plugins
  • dea784378 @putout/processor-filesystem: is-filesystem
  • 5cfd75e0f putout: @putout/plugin-nodejs v9.0.0
  • 729e93cc8 putout: @putout/plugin-tape v12.0.0
  • 29c77ff0f @putout/plugin-tape: drop support of 🐊 < 33
  • 54f56992e putout: @putout/plugin-nodejs v8.1.0
  • 71a3e482a putout: @putout/plugin-merge-duplicate-imports v10.0.0
  • 67b22c688 @putout/plugin-nodejs: drop support of 🐊 < 33
  • 67f1dde3a @putout/plugin-merge-duplicate-imports: drop support of 🐊 < 33
  • fa96049c3 @putout/plugin-merge-duplicate-imports: improve support of tape/declare, nodejs/convert-esm-to-commonjs
  • 4befa6ead @putout/plugin-nodejs: merge convert-esm-to-commonjs
  • fbae70329 @putout/plugin-nodejs: merge convert-commonjs-to-esm
  • d36d198f8 @putout/plugin-nodejs: convert-exports-to-module-exports: add (#191)
putout - putout v32.16.0

Published by coderaiser 12 months ago

🐞 fix

  • 47a7dea06 @putout/processor-filesystem: init
  • 52274ed96 @putout/operate: traverseProperties: path
  • 0e1855807 @putout/cli-choose-formatter: no .putout.json

πŸ”₯ feature

  • 8eb0ac092 @putout/plugin-putout: declare: findFiles, renameFile
  • 127c173f0 putout: @putout/operator-filesystem v1.0.1
  • e87678d74 putout: @putout/plugin-filesystem: add
  • e33a6cf10 @putout/processor-filesystem: @putout/cli-filesystem v1.0.0
  • e2f6e8075 putout: @putout/processor-filesystem v1.0.0
  • bfec7f7c1 putout: @putout/plugin-filesystem v1.0.0
  • 32456ff4d @putout/processor-filesystem: init
  • 2e0098939 putout: @putout/operator-filesystem: add
  • 4e45f05e5 @putout/plugin-filesystem: add
  • c020b1077 eslint-plugin-putout: @stylistic/eslint-plugin-ts v1.0.0
  • aa5808cb2 eslint-plugin-putout: @stylistic/eslint-plugin-jsx v1.0.0
  • e22c2d267 @putout/eslint-config: @stylistic/eslint-plugin-js v1.0.0
  • a21c7e8ad @putout/cli-filesystem: add
  • c6e5581cf @putout/processor-filesystem: add
  • 0f9ba929b @putout/operator-filesystem: add
  • 3eca2e295 @putout/test: preTest: 1 -> name of a plugin
  • 9d9a53a35 @putout/operate: traverseProperties: improve
  • 88b5e0899 @putout/plugin-github: update-actions: actions/checkout, actions/setup-node v4
  • 48c2fde76 @putout/cli-choose-formatter: preserve formatter options
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