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 v27.5.0

Published by coderaiser about 2 years ago

πŸ”₯ feature

  • package: @putout/plugin-remove-empty v9.0.0
  • @putout/plugin-remove-empty: apply getRule
  • @putout/plugin-remove-empty: drop support of 🐊 < 27
  • @putout/plugin-remove-empty: add support of nested patterns (#109)
putout - putout v27.4.0

Published by coderaiser about 2 years ago

πŸ”₯ feature

  • package: @putout/plugin-remove-console v5.0.0
  • @putout/plugin-remove-console: drop support of 🐊 < 27
  • @putout/plugin-remove-console: simplify a bit
  • @putout/rule-set-commit-type: add
putout - putout v27.3.1

Published by coderaiser about 2 years ago

🐞 fix

  • putout: exit codes
putout - putout v27.3.0

Published by coderaiser about 2 years ago

🐞 fix

  • @putout/plugin-madrun: description

πŸ”₯ feature

  • @putout/plugin-logical-expressions: add remove-duplicates
  • @putout/plugin-logical-expressions: add
  • (package) @putout/plugin-simplify-logical-expressions v4.0.0
  • (@putout/plugin-simplify-logical-expressions) merge @putout/plugin-remove-duplicates-from-logical-expressions
putout - putout v27.2.0

Published by coderaiser about 2 years ago

πŸ”₯ feature

  • (package) @putout/plugin-simplify-logical-expressions v4.0.0
  • (@putout/plugin-simplify-logical-expressions) merge @putout/plugin-remove-duplicates-from-logical-expressions
  • (@putout/plugin-convert-const-to-let) improve support of split-variable-declarations
  • (@putout/plugin-extract-object-properties) deep-equal: traverse: path -> initPath
  • (@putout/plugin-declare-imports-first) add support of export from
putout - putout v27.1.0

Published by coderaiser about 2 years ago

Welcome a new store pathStore!

Hi folks!

Just landed more stable version of listStore: pathStore.

When you want additional check that path not removed by other plugins.

debugger;
const hello = '';

Let's process it!

module.exports.traverse = ({pathStore}) => ({
    'debugger'(path) {
        pathStore(path);
        path.remove();
    },
    
    Program: {
        exit() {
            console.log(pathStore());
            // returns
            [];
        },
    },
});

So use pathStore when you need to work with path, and use listStore for anything else, it will save you from headaches :).

That's all for now! Have a nice day :)!

πŸ”₯ feature

  • (eslint-plugin-putout) wrap: add schema
  • (eslint-plugin-putout) putout: schema (close typescript-eslint/typescript-eslint#5420)
  • (package) @putout/plugin-declare-imports-first v2.0.0
  • (package) @putout/plugin-merge-duplicate-imports v7.0.0
  • (package) @putout/plugin-nodejs v5.0.0
  • (package) @putout/plugin-typescript v3.0.0
  • (package) @putout/engine-runner v14.0.0
  • (@putout/plugin-typescript) drop support of 🐊 < 27
  • (@putout/plugin-typescript) remove-duplicates-from-union: listStore -> pathStore
  • (@putout/test) UPDATE: add support of TypeScript fixtures
  • (@putout/plugin-nodejs) drop support of 🐊 < 27
  • (@putout/plugin-nodejs) declare-after-require: listStore -> pathStore
  • (@putout/plugin-merge-duplicate-imports) listStore -> pathStore
  • (@putout/plugin-merge-duplicate-imports) drop support of 🐊 < 27
  • (@putout/plugin-declare-imports-first) drop support of 🐊 < 27
  • (@putout/plugin-declare-imports-first) listStore -> pathStore
  • (@putout/engine-runner) store: add pathStore: with additional check that path not removed
  • (@putout/plugin-declare-imports-first) improve support of removed ImportDeclarations
  • (@putout/plugin-remove-empty) pattern: improve support of AsyncFunctionExpression
  • (@putout/plugin-remove-nested-blocks) improve support of @putout/plugin-remove-empty
  • (@putout/plugin-remove-empty) improve support of @putout/plugin-remove-unused-for-of-variables
  • (@putout/processor-markdown) find, fix: add ability to pass additional plugins from options
  • (@putout/plugin-nodejs) add convert-buffer-to-buffer-alloc
  • (@putout/operate) improve compute check
  • (@putout/plugin-putout) convert-number-to-numeric: improve support cases when both Number and Numeric declared
  • (@putout/plugin-react-router) add convert-component-to-element
  • (@putout/plugin-react-router) add
putout - putout v27.0.1

Published by coderaiser over 2 years ago

🐞 fix

  • (putout) match: .eslintrc.* -> .eslintrc{*,.json}
putout - putout v27.0.0

Published by coderaiser over 2 years ago

image

β€œMan follows Earth, Earth follows Heaven. Heaven follows the Tao. Yet the Tao follows Nature. Tao produced one. One produced two. Two produced Three. Three produced ten thousand beings. Ten thousand beings carry yin and embrace yang; By blending their energies they achieve harmony. Therefore existence and nonexistence produce each other. Difficulty and ease complement each other. Long and short contrast with each other. High and low rely on each other. Sound and voice harmonize with each other. Front and back follow each other. The Tao fulfills its purpose quietly and makes no claim. When success is achieved, withdrawing. The highest good is like water. Water benefits ten thousand beings, Yet it does not contend. Nothing under Heaven is as soft and yielding as water. Yet in attacking the firm and strong, Nothing is better than water.”

(c) I Ching

Hi folks!

The time is come for the new 🐊Putout release. It has a couple breaking changes... to the point!

Introduces @putout/eslint.

The time is come to move out all ESLint related stuff to separate package. So if you used it make changes:

npm i @putout/eslint
-import eslint from 'putout/eslint';
+import eslint from '@putout/eslint';

And use it as before according to ESLint API.

πŸšͺExit Codes

Next two exit codes switched and now has next numbers:

Code Name Description Example
9 CANNOT_LOAD_FORMATTER formatter has errors 🐊 @putout/formatter-dump: Syntax error
13 UNHANDLED unhandled exception <unhandled exception>

Introduced logical-expressions

From now logical-expressions includes:

If you disabled for some reason some of this rules what you need to do in your .putout.json is:

{
    "rules": {
-        "remove-boolean-from-logical-expressions": "off",
-        "convert-bitwise-to-logical": "off",
-        "simplify-logical-expressions": "off",
-        "remove-duplicates-from-logical-expressions": "off",
+        "logical-expressions/remove-boolean": "off",
+        "logical-expressions/convert-bitwise-to-logical": "off",
+        "logical-expressions/simplify": "off",
+        "logical-expressions/remove-duplicates": "off",
    }
}

Now we have 3 dependencies less πŸ₯³!

Dropped support of eslint-plugin-node

eslint-plugin-node wasn't updated for two years, so it was forked to eslint-plugin-n which is well supported.

Thanks a lot @aladdin-add for maintaining this fork!

eslint-plugin-putout now uses eslint-plugin-n as direct dependency (to have same rules disabled, for markdown files, for example). So to avoid any confusion also 🐊Putout has a major version bump with a new rule in @putout/plugin-eslint called convert-node-to-n:

{
    "extends": [
        "plugin:putout/safe+align",
-       "plugin:node/recommended"
+       "plugin:n/recommended"
    ],
    "plugins": [
        "putout",
-       "node"
+       "n"
    ]
}

All you need to do is to use nupdate tool:

nupdate putout -c;
nupdate eslint-plugin-putout -c;
nupdate eslint-plugin-n -aDc;
yarn;
putout --fix .
nupdate eslint-plugin-node -r;
git commit -am 'feature: now I have eslint-plugin-n βœ…'

Also GitHub Actions benefit from this change, since it is already has an auto fix, and if only .eslintrc.json will be updated everything will broke down πŸ€·β€β™‚οΈ.

Have a nice day πŸŽ‰!

πŸ”₯ feature

  • (putout) add ability to convert eslint-plugin-node to eslint-plugin-n
putout - putout v26.25.1

Published by coderaiser over 2 years ago

🐞 fix

  • (putout) freeze @putout/[email protected]
  • (@putout/test) description: add 🐊
  • (@putout/test) processor: UPDATE

πŸ”₯ feature

  • (package) hermes-parser v0.9.0
  • (@putout/test) processor: improve testing
  • (@putout/test) processsor: add support of UPDATE
putout - putout v26.25.0

Published by coderaiser over 2 years ago

🐞 fix

  • (eslint-plugin-putout) no-unresolved: missing ./ after transform
  • (@putout/plugin-react-hooks) remove-this: exclude not MemberExpressions

πŸ”₯ feature

  • (package) eslint-plugin-putout v16.0.0
  • (@putout/test) eslint-plugin-node -> eslint-plugin-n
  • (putout) match: .eslintrc.json -> .eslintrc.*
  • (@putout/cli-cache) add ability to handle case where meta is null (while rebasing)
  • (eslint-plugin-putout) eslint-plugin-node -> eslint-plugin-n
  • (@putout/plugin-eslint) add convert-node-to-n
  • (@putout/plugin-react-hooks) convert-state-to-hook: exclude shorthand properties
  • (@putout/plugin-react-hooks) convert-class-to-function: exclude classes with lifecycle
  • (@putout/plugin-react-hooks) convert-state-to-hooks: exclude AssignmentExpression not related to MemberExpression
  • (@putout/plugin-remove-nested-blocks) improve support of reduce
  • (@putout/plugin-convert-reduce-to-for-of) improve support of reduce
putout - putout v26.24.0

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (putout) config: create-react-app: setupTests: improve support
  • (putout) config: ignore: add .idea
  • (@putout/plugin-react-hooks) declare: add useCallback
  • (@putout/plugin-react-hooks) declare: add useReducer
  • (@putout/plugin-remove-unreferenced-variables) report
  • (@putout/plugin-remove-unreferenced-variables) add support of upper scope
  • (@putout/plugin-react-hooks) add apply-short-fragment
  • (@putout/plugin-react-hooks) add declare
  • (@putout/plugin-putout) convert-number-to-numeric: add support of NumberLiteral
  • (@putout/plugin-putout) add convert-number-to-numeric
  • (@putout/plugin-tape) convert-equal-to-not-ok: add support of compute
  • (@putout/plugin-tape) convert-equal-to-ok: add compute
  • (@putout/processor-wasm) lock versions (xtuc/webassemblyjs#1132)
  • (@putout/plugin-eslint) add add-putout
  • (@putout/plugin-eslint) get
  • (@putout/plugin-tape) convert-deep-equal-to-equal: add support of null, undefined and boolean
  • (@putout/plugin-tape) convert-deep-equal-to-equal: add support of number
  • (@putout/plugin-tape) convert-deepe-qual-to-equal: add support of Strings
  • (@putout/plugin-putout) declare: add support of "compute"
  • (@putout/plugin-apply-comparison-order) exclude OptionalMemberExpression
  • (@putout/processor-html) add support of svelte
putout - putout v26.23.0

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (putout) svelte: disable remove-unused-variables: since variables can be used in markup
putout - putout v26.22.0

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (putout) parse-options: validate-options: processors: on/off tuple
  • (@putout/plugin-declare-undefined-variables) Object: add freeze
putout - putout v26.21.0

Published by coderaiser over 2 years ago

🐞 fix

  • (@putout/plugin-convert-comparison-to-boolean) report message

πŸ”₯ feature

  • (putout) check that source has type string
  • (@putout/test) eslint: comparePlaces: add support of overrides
putout - putout v26.20.0

Published by coderaiser over 2 years ago

🐞 fix

  • feature(@putout/engine-runner) run improve logging: determine nested level of path
  • (@putout/operator-declare) module type get while find
  • (@putout/plugin-declare-before-reference) no new line
  • (@putout/plugin-convert-const-to-let) simplify
  • (@putout/plugin-convert-const-to-let) report after transform

πŸ”₯ feature

  • (package) @putout/plugin-simplify-logical-expressions v3.0.0
  • (@putout/plugin-simplify-logical-expressions) drop support of 🐊 < 26
  • (@putout/eslint-config) yoda: disabled, @putout/apply-comparison-order used instead
  • (@putout/plugin-apply-comparison-order) add
  • (@putout/plugin-simplify-logical-expressions) add support of comparison with [], {}
  • (eslint-plugin-putout) add-newline-before-return: improve loop: for begin -> from end
  • (@putout/plugin-try-catch) add support of no error param
  • (@putout/engine-runner) run ## 🐞 fix
    improve logging: determine nested level of path
  • (@putout/eslint-config) padding-if: always: before and after
  • (@putout/plugin-convert-const-to-let) improve support of multiple
putout - putout v26.19.0

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (@putout/plugin-convert-const-to-let) add
  • (@putout/plugin-convert-for-each-to-for-of) add support of index
  • (@putout/plugin-declare-before-reference) improve support of ancestry
putout - putout v26.18.0

Published by coderaiser over 2 years ago

🐞 fix

  • (@putout/engine-loader) add putout to peerDependencies to make putout work when installed with pnpm (#106)

πŸ”₯ feature

  • (@putout/plugin-declare-imports-ifrst) add
  • (@putout/plugin-try-catch) args: exclude bind
  • (eslint-plugin-putout) add add-newline-before-return
putout - putout v26.17.0

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (putout) ESM: disable strict-mode/add-missing
putout - putout v26.16.1

Published by coderaiser over 2 years ago

πŸ”₯ feature

  • (package) stylelint-config-standard v26.0.0
  • (package) @putout/cli-cache v2.0.1
  • (@putout/plugin-convert-mock-require-to-mock-import) improve support of stopAll
  • (@putout/plugin-putout) declare: add getPathAfterImports
  • (@putout/plugin-convert-commonjs-to-esm) improve support of dot-dot
  • (@putout/plugin-convert-commonjs-to-esm) add support of require(".")
putout - putout v26.16.0

Published by coderaiser over 2 years ago

🐞 fix

  • (@putout/plugin-nodejs) declare-fafter-require: exports

πŸ”₯ feature

  • (package) @putout/plugin-convert-mock-require-to-mock-import v4.0.0
  • (@putout/plugin-convert-mock-require-to-mock-import) drop support of 🐊 < 26
  • (@putout/plugin-convert-mock-require-to-mock-import) do not declare, keep it for tape/declare
  • (@putout/plugin-remove-useless-arguments) add support of method
  • (@putout/plugin-remove-useless-arguments) report
  • (package) @putout/plugin-eslint v4.0.0
  • (@putout/plugin-eslint) drop support of 🐊 < 26
  • (@putout/plugin-eslint) add remove-no-unsupported-features
  • (@putout/plugin-nodejs) declare-after-require: add support of ExportDeclaration
  • (@putout/plugin-nodejs) declare-after-require: improve support of references
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