open-index/open-npm huggingface dataset:
npm package: @putout/plugin-apply-numeric-separators
Description: 🐊Putout plugin adds ability apply numeric separators
Author: coderaiser
Latest version: 1.2.2

# @putout/plugin-apply-numeric-separators [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-numeric-separators.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-numeric-separators"npm"

> To improve readability for numeric literals, underscores (`_`) can be used as separators.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin apply **numeric separators**. Merged to [`@putout/plugin-math`](https://www.npmjs.com/package/@putout/plugin-math).

## Install

```
npm i @putout/plugin-apply-numeric-separators
```

## Rule

```json
{
    "rules": {
        "apply-numeric-separators": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const t = 10000000;
```

## ✅ Example of correct code

```js
const t = 10_000_000;
```

## License

MIT
npm package: @putout/plugin-apply-optional-chaining
Description: 🐊Putout plugin adds ability apply optional chaining
Author: coderaiser
Latest version: 6.0.1

# @putout/plugin-apply-optional-chaining [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-optional-chaining.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-optional-chaining "npm"

> The **optional chaining operator** (`?.`) enables you to read the value of a property located deep within a chain of connected objects without having to check that each reference in the chain is valid.
>
> The `?.` operator is like the `.` chaining operator, except that instead of causing an error if a reference is nullish (`null` or `undefined`), the expression short-circuits with a return value of `undefined`. When used with function calls, it returns `undefined` if the given function does not exist.
>
> This results in shorter and simpler expressions when accessing chained properties when the possibility exists that a reference may be missing. It can also be helpful while exploring the content of an object when there's no known guarantee as to which properties are required.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin applies **optional chaining**. Backward to [`convert-optional-to-logical`](https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-optional-to-logical#readme). Merged to [`@putout/plugin-optional-chaining`](https://www.npmjs.com/package/@putout/plugin-optional-chaining).

## Install

```
npm i @putout/plugin-apply-optional-chaining
```

## Rule

```json
{
    "rules": {
        "apply-optional-chaining/use": "on",
        "apply-optional-chaining/assign": "off"
    }
}
```

## use

Checkout out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/d308302b95800920d324b799f1a948e3/99d03cb297d17446885829e8583b3cc7777367c5).

### ❌ Example of incorrect code

```js
const result = hello && hello.world;

if (typeof a === 'function' && a(1, 2))
    alert();
```

### ✅ Example of correct code

```js
const result = hello?.world;

if (a?.(1, 2))
    alert();
```

## assign

> Proposal to add support for optional chaining on the left of assignment operators: `a?.b = c`.
>
> (c) [Proposal of Optional Chaining Assignment](https://github.com/tc39/proposal-optional-chaining-assignment)

Disabled by default. Checkout out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/74bde454f909b7f9d13e80da10e12a15/d31bd20ca18fefe474bb8ab73f963e47dffb89e7).

### ❌ Example of incorrect code

```js
if (a) {
    a.b = 5;
}

if (a)
    a.b = 5;

a && (a.b = 5);
```

### ✅ Example of correct code

```js
a?.b = 5;
```

## License

MIT
npm package: @putout/plugin-apply-overrides
Description: 🐊Putout plugin adds ability apply 'overrides'
Author: coderaiser
Latest version: 3.0.0

# @putout/plugin-apply-overrides [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-overrides.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-overrides "npm"

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `overrides`.

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/2f03cfd6d8dab1431ef388fb9168a017/098a08fd5ba26e5b7dc12e3adcd9766dce6aca0c).

When you write testable code and want to avoid mocking `require`d or `import`ed modules, one of a solutions to use simple form
of dependency injection:

```js
import {readDirSync as _readdirSync} from 'node:fs/promises';

export const readRules = (dirOpt, rulesDir, overrides = {}) => {
    const {
        cwd,
        readdirSync = _readdirSync,
    } = overrides;
};
```

Pass `overrides` as last parameter, in this case use can test easily your function `readFules`:

```js
import {test, stub} from 'supertape';

test('readRules', (t) => {
    const readdirSync = stub().returns([]);
    const rules = readRules('', '', {
        readdirSync,
    });
    
    t.equal(rules, []);
    t.end();
});
```

Then only issue is, when you have lots of parameters, your function declaration will be to long, or to hard to read, so recommended way is to use `overrides` variable.

## Install

```
npm i @putout/plugin-apply-overrides
```

## Rule

```json
{
    "rules": {
        "apply-overrides": "on"
    }
}
```

## ❌ Example of incorrect code

```js
async function matchToFlatDir(path, config, {readESLintConfig = _readESLintConfig} = {}) {}
```

## ✅ Example of correct code

```js
async function matchToFlatDir(path, config, overrides = {}) {
    const {
        readESLintConfig = _readESLintConfig,
    } = overrides;
}
```

## License

MIT
npm package: @putout/plugin-apply-shorthand-properties
Description: 🐊Putout plugin adds ability to apply shorthand properties
Author: coderaiser
Latest version: 7.4.0

# @putout/plugin-apply-shorthand-properties [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-shorthand-properties.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-shorthand-properties "npm"

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply shorthand properties.

## Install

```
npm i @putout/plugin-apply-shorthand-properties -D
```

## Config

```json
{
    "rules": {
        "apply-shorthand-properties": ["on", {
            "ignore": [],
            "rename": false
        }]
    },
    "plugins": [
        "apply-shorthand-properties"
    ]
}
```

## With default options

### ❌ Example of incorrect code

```js
import {'b' as b} from 'b';

const {a: a} = b;
```

### ✅ Example of correct code

```js
import {b} from 'b';

const {a} = b;
```

## When `rename` enabled

### ❌ Example of incorrect code

```js
const AUTH_SESSION = 'xx';

export const setSession = (session) => ({
    type: AUTH_SESSION,
    payload: session,
});
```

### ✅ Example of correct code

```js
const type = 'xx';

export const setSession = (payload) => ({
    type,
    payload,
});
```

## Comparison

Linter | Rule | Fix
--------|-------|------------|
🐊 **Putout** | [`apply-shorthand-properties`](https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-shorthand-properties#readme) | ✅
⏣ **ESLint** | [`no-useless-rename`](https://eslint.org/docs/rules/no-useless-rename) | ❌

## License

MIT
npm package: @putout/plugin-apply-starts-with
Description: 🐊Putout plugin adds ability apply to '.starts.with()'
Author: coderaiser
Latest version: 2.0.0

# @putout/plugin-apply-starts-with [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-starts-with.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-starts-with "npm"

> The `startsWith()` method determines whether a string begins with the characters of a specified string, returning `true` or `false` as appropriate.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `.startsWith()`.

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/cf2892d814886a8faf4497abb76e5939/ca92bbe553079063473e8836b602f4c547b364d4).

## Install

```
npm i @putout/plugin-apply-starts-with
```

## Rule

```json
{
    "rules": {
        "apply-starts-with": "on"
    }
}
```

## ❌ Example of incorrect code

```js
function x(a = '') {
    if (!a.indexOf('1'))
        return false;
}

function x1({a = ''}) {
    return !a.indexOf('1');
}

function x2() {
    const {a = ''} = z;
    return !a.indexOf('1');
}
```

## ✅ Example of correct code

```js
function x(a = '') {
    return a.startsWith('1');
}

function x1({a = ''}) {
    return a.startsWith('1');
}

function x2() {
    const {a = ''} = z;
    return a.startsWith('1');
}
```

## License

MIT
npm package: @putout/plugin-apply-template-literals
Description: 🐊Putout plugin adds ability to apply template literals
Author: coderaiser
Latest version: 5.0.0

# @putout/plugin-apply-template-literals [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-template-literals.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-template-literals "npm"

> Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
> Template literals are sometimes informally called template strings, because they are used most commonly for string interpolation (to create strings by doing substitution of placeholders
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `template literals`. Check out in [🐊**Putout Editor**](https://putout.cloudcmd.io/#/gist/a3943037348a9f5ff100a972f8e83d9f/718a8997a89790e7fa507114dc1f4984637e92d4).

## Install

```
npm i @putout/plugin-apply-template-literals
```

## Rule

```json
{
    "rules": {
        "apply-template-literals": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const line = '("' + name + '")';
```

## ✅ Example of correct code

```js
const line = `("${name}")`;
```

## Comparison

Linter | Rule | Fix
--------|-------|------------|
🐊 **Putout** | [`apply-template-literals`](https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-template-literals#readme) | ✅
⏣ **ESLint** | [`prefer-template`](https://eslint.org/docs/latest/rules/prefer-template) | ✅

## License

MIT
npm package: @putout/plugin-apply-top-level-await
Description: putout plugin adds ability to apply top level await
Author: coderaiser
Latest version: 2.0.2

# @putout/plugin-apply-top-level-await [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-top-level-await.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-top-level-await"npm"

🐊[`Putout`](https://github.com/coderaiser/putout) plugin applies [top-level-await](https://v8.dev/features/top-level-await). Part of [@putout/promises](https://github.com/coderaiser/putout/tree/v24.5.0/packages/plugin-promises).

## Install

```
npm i @putout/plugin-apply-top-level-await
```

## Rule

```json
{
    "rules": {
        "apply-top-level-await": "on"
    }
}
```

## ❌ Incorrect code example

```js
import fs from 'fs';
(async () => {
    const data = await fs.promises.readFile('hello.txt');
})();
```

## ✅ Correct code Example

```js
import fs from 'fs';
const data = await fs.promises.readFile('hello.txt');
```

## License

MIT
npm package: @putout/plugin-apply-try-catch
Description: putout plugin adds ability apply try-catch
Author: coderaiser
Latest version: 2.8.1

# @putout/plugin-apply-try-catch [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-try-catch.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-try-catch "npm"

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply [tryCatch](https://github.com/coderaiser/try-catch) and [tryToCatch](https://github.com/coderaiser/try-to-catch). Renamed to [`@putout/plugin-try-catch`](https://www.npmjs.com/package/@putout/plugin-try-catch).

## Install

```
npm i @putout/plugin-apply-try-catch
```

## Rule

```json
{
    "rules": {
        "apply-try-catch/await": "on",
        "apply-try-catch/args": "on",
        "apply-try-catch/declare": "on",
        "apply-try-catch/expand-arguments": "on",
        "apply-try-catch/try-catch": "on",
        "apply-try-catch/try-to-catch": "on"
    }
}
```

## try-catch

### ❌ Example of incorrect code

```js
try {
    log('hello');
} catch(error) {
}
```

### ✅ Example of correct code

```js
import tryCatch from 'try-catch';
const [error] = tryCatch(log, 'hello');
```

## try-to-catch

### ❌ Example of incorrect code

```js
try {
    await send('hello');
} catch(error) {
}
```

### ✅ Example of correct code

```js
import tryToCatch from 'try-catch';
const [error] = await tryToCatch(send, 'hello');
```

## await

### ❌ Example of incorrect code

```js
await tryCatch(a, b);
tryToCatch(a, b);
```

### ✅ Example of correct code

```js
await tryToCatch(a, b);
```

## args

### ❌ Example of incorrect code

```js
tryCatch(send('hello'));
```

### ✅ Example of correct code

```js
tryCatch(send, 'hello');
```

## declare

### ❌ Example of incorrect code

```js
const [error] = tryCatch(fs.readFileSync, 'hello.txt');
```

### ✅ Example of correct code

```js
import tryCatch from 'try-catch';
const [error] = tryCatch(fs.readFileSync, 'hello.txt');
```

## expand-arguments

### ❌ Example of incorrect code

```js
import tryCatch from 'try-catch';

test('some message', (t) => {
    const fn = () => copymitter('/hello');
    const [error] = tryCatch(fn);
    
    t.equal(error.message, 'to should be a string!');
    t.end();
});
```

### ✅ Example of correct code

```js
import tryCatch from 'try-catch';

test('some message', (t) => {
    const [error] = tryCatch(copymitter, '/hello');
    
    t.equal(error.message, 'to should be a string!');
    t.end();
});
```

## License

MIT
npm package: @putout/plugin-apply-utility-types
Description: putout plugin adds ability use apply utility types
Author: coderaiser
Latest version: 1.0.1

# @putout/plugin-apply-utility-types [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-utility-types.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-utility-types"npm"

🐊[`Putout`](https://github.com/coderaiser/putout) plugin adds ability to apply `utility types`.
Moved to [`@putout/plugin-typescript`](https://github.com/coderaiser/putout/v24.0.2/master/packages/plugin-typescript#apply-utility-types).

## Install

```
npm i @putout/plugin-apply-utility-types
```

## Rule

```json
{
    "rules": {
        "apply-utility-types": "on"
    }
}
```

## ❌ Incorrect code example

```ts
type SuperType1 = {
    [Key in keyof Type]?: Type[Key];
};
```

## ✅ Correct code Example

```ts
type SuperType1 = Partial<Type>;
```

## License

MIT
npm package: @putout/plugin-browserlist
Description: 🐊Putout plugin helps with .browserlistrc
Author: coderaiser
Latest version: 2.0.0

# @putout/plugin-browserlist [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-browserlist.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-browserlist"npm"

🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with [browserlist](https://github.com/browserslist/browserslist).

## Install

```
npm i @putout/plugin-browserlist -D
```

## Rules

```json
{
    "rules": {
        "browserlist/remove-node-versions": "on"
    }
}
```

## Remove node versions

Fixes webpack error [Universal Chunk Loading is not implemented yet](https://github.com/webpack/webpack/issues/11660).
Removes `maintained node versions`` from `.browserlist`.

```diff
node_modules
last 2 Chrome versions
last 2 Safari versions
Firefox ESR
-maintained node versions
not dead
```

## License

MIT
npm package: @putout/plugin-convert-any-to-primitive
Description: putout plugin adds ability to convert any to primitive type
Author: coderaiser
Latest version: 1.0.2

# @putout/plugin-convert-any-to-primitive [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-any-to-primitive.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-any-to-primitive "npm"

🐊[`Putout`](https://github.com/coderaiser/putout) plugin adds ability to convert `any` to primitive.
Moved to [`@putout/plugin-typescript`](https://github.com/coderaiser/putout/tree/v24.0.2/packages/plugin-typescript).

## Install

```
npm i @putout/plugin-convert-any-to-primitive -D
```

## Rule

Rule `convert-any-to-primitive` is enabled by default for `ts` and `tsx` files, to disable add to `.putout.json`:

```json
{
    "rules": {
        "convert-any-to-primitive": "off"
    }
}
```

## ❌ Incorrect code example

```ts
const x: any = 5;
```

## ✅ Correct code Example

```ts
const x: number = 5;
```

## License

MIT
npm package: @putout/plugin-convert-apply-to-spread
Description: 🐊Putout plugin adds ability to convert 'apply' to 'spread'
Author: coderaiser
Latest version: 4.0.1

# @putout/plugin-convert-apply-to-spread [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-apply-to-spread.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-apply-to-spread "npm"

> Spread syntax (`...`) allows an array expression to be expanded in places where zero or more arguments are expected.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `apply` to `spread`. Merged with [`@putout/plugin-spread`](https://www.npmjs.com/package/@putout/plugin-spread#convert-apply-to-spread).

## Install

```
npm i @putout/plugin-convert-apply-to-spread -D
```

## Rule

```json
{
    "rules": {
        "convert-apply-to-spread": "on"
    }
}
```

## ❌ Example of incorrect code

```js
console.apply(null, arguments);
```

## ✅ Example of correct code

```js
console.log(...arguments);
```

## License

MIT
npm package: @putout/plugin-convert-arguments-to-rest
Description: 🐊Putout plugin adds ability to convert arguments to rest
Author: coderaiser
Latest version: 4.0.1

# @putout/plugin-convert-arguments-to-rest [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-arguments-to-rest.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-arguments-to-rest "npm"

> The rest parameter syntax allows a function to accept an indefinite number of arguments as an `array`, providing a way to represent variadic functions in JavaScript.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `arguments` to `rest`. Merged with [`@putout/plugin-arguments`](https://www.npmjs.com/package/@putout/plugin-arguments).

## Install

```
npm i @putout/plugin-convert-arguments-to-rest -D
```

## Rule

```json
{
    "rules": {
        "convert-arguments-to-rest": "on"
    }
}
```

## ❌ Example of incorrect code

```js
function hello() {
    console.log(arguments);
}
```

## ✅ Example of correct code

```js
function hello(...args) {
    console.log(args);
}
```

## License

MIT
npm package: @putout/plugin-convert-arguments-to-spread
Description: putout plugin adds ability to convert arguments to spread
Author: coderaiser
Latest version: 1.0.1

# putout-plugin-convert-arguments-to-spread [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL]

[NPMIMGURL]:                https://img.shields.io/npm/v/@putout/plugin-convert-arguments-to-spread.svg?style=flat&longCache=true
[NPMURL]:                   https://npmjs.org/package/@putout/plugin-convert-arguments-to-spread "npm"

[DependencyStatusURL]:      https://david-dm.org/coderaiser/putout?path=packages/plugin-convert-arguments-to-spread
[DependencyStatusIMGURL]:   https://david-dm.org/coderaiser/putout.svg?path=packages/plugin-convert-arguments-to-spread

**Renamed to [@putout/convert-arguments-to-rest](https://www.npmjs.com/package/@putout/plugin-convert-arguments-to-rest)**.

`putout` plugin adds ability to convert `arguments` to `spread`.
## Install

```
npm i @putout/plugin-convert-arguments-to-spread -D
```

## Rule

```json
{
    "rules": {
        "convert-arguments-to-spread": true
    }
}
```

## ❌ Incorrect code example

```js
function hello() {
    console.log(arguments);
}
```

## ✅ Correct code Example

```js
function hello(...args) {
    console.log(args);
}
```

## License

MIT
npm package: @putout/plugin-convert-array-copy-to-slice
Description: 🐊Putout plugin adds ability to convert array copy to slice
Author: coderaiser
Latest version: 5.0.0

# @putout/plugin-convert-array-copy-to-slice [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-array-copy-to-slice.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-array-copy-to-slice "npm"

> [**Spread**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) syntax (`...`) allows an array expression to be expanded in places where elements are expected.
>
> The [`slice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) method returns a shallow copy of a portion of an array into a new array.
>
> (c) MDN

🐊[**Putout**](https://github.com/coderaiser/putout) plugin convert **spread** to `slice()`.

## Install

```
npm i @putout/plugin-convert-array-copy-to-slice -D
```

## Rule

```json
{
    "rules": {
        "convert-array-copy-to-slice": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const places = [...items];
```

## ✅ Example of correct code

```js
const places = items.slice();
```

## License

MIT
npm package: @putout/plugin-convert-assert-to-with
Description: 🐊Putout plugin adds ability to convert apply to spread
Author: coderaiser
Latest version: 2.0.1

# @putout/plugin-convert-assert-to-with [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-assert-to-with.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-assert-to-with "npm"

> 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](https://tc39.es/proposal-import-attributes/)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `assert` to `with`.
Check out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/9f85897b998c6458efc19db6a5414b79/57ef7cdd113c7a0087e0f7a6e70522f60baa04f4). Merted with [`@putout/plugin-esm`](https://www.npmjs.com/package/@putout/plugin-esm).

## Install

```
npm i @putout/plugin-convert-assert-to-with -D
```

## Rule

```json
{
    "rules": {
        "convert-assert-to-with": "on"
    }
}
```

## ❌ Example of incorrect code

```js
import json from './foo.json' assert { type: 'json' };

import('foo.json');
```

## ✅ Example of correct code

```js
import json from './foo.json' with { type: 'json' };

import('foo.json');
```

## License

MIT
npm package: @putout/plugin-convert-assignment-to-arrow-function
Description: 🐊Putout plugin adds ability convert assignment to arrow function
Author: coderaiser
Latest version: 1.2.2

# @putout/plugin-convert-assignment-to-arrow-function [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-assignment-to-arrow-function.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-assignment-to-arrow-function"npm"

> The [**assignment operator**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment) (`=`) is used to assign a value to a variable. The assignment operation evaluates to the assigned value. Chaining the assignment operator is possible in order to assign a single value to multiple variables.

Merged to [`@putout/plugin-assignment`](https://www.npmjs.com/package/@putout/plugin-assignment).
>
> An [**arrow function expression**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) is a compact alternative to a **function expression**.
>
> (c) MDN

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert **assignment** to **arrow** function.

## Install

```
npm i @putout/plugin-convert-assignment-to-arrow-function -D
```

## Rule

```json
{
    "rules": {
        "convert-assignment-to-arrow-function": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const createRegExp = a = RegExp(a, 'g');
```

## ✅ Example of correct code

```js
const createRegExp = (a) => RegExp(a, 'g');
```

## License

MIT
npm package: @putout/plugin-convert-assignment-to-comparison
Description: 🐊Putout plugin adds ability convert assignment to comparison
Author: coderaiser
Latest version: 2.0.1

# @putout/plugin-convert-assignment-to-comparison [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-assignment-to-comparison.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-assignment-to-comparison"npm"

> You should almost never have an `if...else` with an assignment like `a = b` as a condition.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert assignment to comparison.

Merged to [`@putout/plugin-assignment`](https://www.npmjs.com/package/@putout/plugin-assignment).

## Install

```
npm i @putout/plugin-convert-assignment-to-comparison -D
```

## Rule

```json
{
    "rules": {
        "convert-assignment-to-comparison": "on"
    }
}
```

## ❌ Example of incorrect code

```js
if (a = b) {}
```

## ✅ Example of correct code

```js
if (a === b) {}
```

## License

MIT
npm package: @putout/plugin-convert-assignment-to-declaration
Description: 🐊Putout plugin adds ability to convert 'assignment' to 'declaration'
Author: coderaiser
Latest version: 2.0.1

# @putout/plugin-convert-assignment-to-declaration [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-assignment-to-declaration.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-assignment-to-declaration "npm"

> The assignment (`=`) operator is used to assign a value to a variable or property.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment)

> The `const` declaration declares block-scoped local variables. The value of a constant can't be changed through reassignment using the assignment operator, but if a constant is an object, its properties can be added, updated, or removed.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `assignment` to `declaration`.
Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/857e6bdc83dc2ee947b2945f6600d417/34d1c3852d85225da7eabdf9b91c138b7533c60b).

Merged to [`@putout/plugin-assignment`](https://www.npmjs.com/package/@putout/plugin-assignment).

## Install

```
npm i @putout/plugin-convert-assignment-to-declaration -D
```

## Rule

```json
{
    "rules": {
        "convert-assignment-to-declaration": "on"
    }
}
```

## ❌ Example of incorrect code

```js
a = 5;
```

## ✅ Example of correct code

```js
const a = 5;
```

## License

MIT
npm package: @putout/plugin-convert-binary-expression-to-boolean
Description: putout plugin adds ability to convert binary expression to boolean
Author: coderaiser
Latest version: 2.1.1

# @putout/plugin-convert-binary-expression-to-boolean [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-binary-expression-to-boolean.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-binary-expression-to-boolean"npm"
[DependencyStatusURL]: https://david-dm.org/coderaiser/putout?path=packages/plugin-convert-binary-expression-to-boolean
[DependencyStatusIMGURL]: https://david-dm.org/coderaiser/putout.svg?path=packages/plugin-convert-binary-expression-to-boolean

`putout` plugin adds ability to find and convert `binary expression` to `boolean`. Renamed to [@putout/plugin-convert-comparison-to-boolean](https://www.npmjs.com/package/@putout/plugin-convert-comparison-to-boolean).

## Install

```
npm i @putout/plugin-convert-binary-expression-to-boolean -D
```

## Rule

```json
{
    "rules": {
        "convert-binary-expression-to-boolean": "on"
    }
}
```

## ❌ Incorrect code example

```js
const t = 2 < 3;
```

## ✅ Correct code Example

```js
const t = false;
```

## License

MIT
npm package: @putout/plugin-convert-bitwise-to-logical
Description: 🐊Putout plugin adds ability to convert bitwice to logical operator
Author: coderaiser
Latest version: 1.0.1

# @putout/plugin-convert-bitwise-to-logical [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-bitwise-to-logical.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-bitwise-to-logical "npm"

> The bitwise **OR** operator (`|`) returns a `1` in each bit position for which the corresponding bits of either or both operands are `1`s.
>
> The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones).
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `bitwise` to `logical` operator, when one of operands is not a number,
since mostly likely it is an error.
Merged to [@putout/plugin-logical-expressions](https://www.npmjs.com/package/@putout/plugin-logical-expressions).

## Install

```
npm i @putout/plugin-convert-bitwise-to-logical -D
```

## Rule

```json
{
    "rules": {
        "convert-bitwise-to-logical": "on"
    }
}
```

## ❌ Example of incorrect code

```js
a | !b;
```

## ✅ Example of correct code

```js
a || !b;
```

## License

MIT
npm package: @putout/plugin-convert-break-to-return
Description: 🐊Putout plugin adds ability to convert 'break' to 'return'
Author: coderaiser
Latest version: 1.0.5

# @putout/plugin-convert-break-to-return [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-break-to-return.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-break-to-return "npm"

> The `break` statement terminates the current loop or switch statement and transfers program control to the statement following the terminated statement.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax)

> `SyntaxError: unlabeled break must be inside loop or switch`
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Bad_break)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `break` to `return`. Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/a321ee4d76a066c17835b4aa50f91499/10646f7383b8d58cda02417485d5281955da95be). Merged with [`@putout/plugin-return`](https://www.npmjs.com/package/@putout/plugin-return).

## Install

```
npm i @putout/plugin-convert-break-to-return -D
```

## Rule

```json
{
    "rules": {
        "convert-break-to-return": "on"
    }
}
```

## ❌ Example of incorrect code

```ts
function x() {
    if (a)
        break;
    
    return false;
}
```

## ✅ Example of correct code

```js
function x() {
    if (a)
        return;
    
    return false;
}
```

## License

MIT
npm package: @putout/plugin-convert-commonjs-to-esm
Description: 🐊Putout plugin adds ability to convert commonjs to ecma script module
Author: coderaiser
Latest version: 10.0.1

# @putout/plugin-convert-commonjs-to-esm [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-commonjs-to-esm.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-commonjs-to-esm "npm"

> **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](https://parceljs.org/languages/javascript/)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert CommonJS to ESM. Use [`@putout/plugin-nodejs`](https://www.npmjs.com/package/@putout/plugin-nodejs) instead.

## Install

```
npm i @putout/plugin-convert-commonjs-to-esm -D
```

## Rule

```json
{
    "rules": {
        "convert-commonjs-to-esm/require": "on",
        "convert-commonjs-to-esm/exports": "on",
        "convert-commonjs-to-esm/commons": "on"
    }
}
```

# require

## ❌ Example of incorrect code

```js
const {join} = require('path');

const args = require('minimist')({
    string: ['a', 'b'],
});
```

## ✅ Example of correct code

```js
import {join} from 'path';
import minimist from 'minimist';

const args = minimist({
    string: ['a', 'b'],
});
```

# exports

## ❌ Example of incorrect code

```js
module.exports = () => {};
```

## ✅ Example of correct code

```js
export default () => {};
```

# Commons

## ❌ Example of incorrect code

```js
const {readFile} = require('fs/promises');

await readFile(__filename);
```

## ✅ Example of correct code

```js
import {readFile} from 'fs/promises';
import {fileURLToPath} from 'url';

const __filename = fileURLToPath(import.meta.url);
await readFile(__filename);
```

## License

MIT
npm package: @putout/plugin-convert-comparison-to-boolean
Description: 🐊Putout plugin adds ability to convert comparison to boolean
Author: coderaiser
Latest version: 3.0.3

# @putout/plugin-convert-comparison-to-boolean [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-comparison-to-boolean.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-comparison-to-boolean"npm"

> Strict equality compares two values for equality. Neither value is implicitly converted to some other value before being compared. If the values have different types, the values are considered unequal.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to find and convert `binary expression` to `boolean`. Merged to [`@putout/plugin-conditions`](https://www.npmjs.com/package/@putout/plugin-conditions).

## Install

```
npm i @putout/plugin-convert-comparison-to-boolean -D
```

## Rule

```json
{
    "rules": {
        "convert-comparison-to-boolean": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const t = 2 < 3;
```

## ✅ Example of correct code

```js
const t = false;
```

## License

MIT
npm package: @putout/plugin-convert-concat-to-flat
Description: 🐊Putout plugin adds ability to convert concat to flat
Author: coderaiser
Latest version: 2.0.0

# @putout/plugin-convert-concat-to-flat [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-concat-to-flat.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-concat-to-flat "npm"

> The `flat()` method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `concat` to `flat`.

## Install

```
npm i @putout/plugin-convert-concat-to-flat -D
```

## Rule

```json
{
    "rules": {
        "convert-concat-to-flat": "on"
    }
}
```

## ❌ Example of incorrect code

```js
[].concat(...array);
```

## ✅ Example of correct code

```js
array.flat();
```

## License

MIT
npm package: @putout/plugin-convert-const-to-let
Description: 🐊Putout plugin adds ability to convert 'const' to 'let'
Author: coderaiser
Latest version: 5.0.1

# @putout/plugin-convert-const-to-let [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-const-to-let.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-const-to-let "npm"

> The `TypeError` object represents an error when attempting to modify a value that cannot be changed.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `const` to `let` to avoid `TypeError`. Merged with [`@putout/plugin-variables`](http://npmjs.com/package/@putout/plugin-variables).

Check out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/61ffff64a356c47e66af4ea17a9a755d/e7f5fa455c208a7faa9319d94130996d39afcbf7).

## Install

```
npm i @putout/plugin-convert-const-to-let -D
```

## Rule

```json
{
    "rules": {
        "convert-const-to-let": "on"
    }
}
```

## ❌ Example of incorrect code

```js
const a = 5;

a = 3;
```

## ✅ Example of correct code

```js
let a = 5;

a = 3;
```

## License

MIT
npm package: @putout/plugin-convert-equal-to-strict-equal
Description: 🐊Putout plugin adds ability to convert equal to strict equal
Author: coderaiser
Latest version: 1.1.1

# @putout/plugin-convert-equal-to-strict-equal [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-equal-to-strict-equal.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-equal-to-strict-equal "npm"

> The **strict equality** operator (`===`) checks whether its two operands are equal, returning a `Boolean` result. Unlike the **equality** operator (`==`), the **strict equality** operator always considers operands of different types to be different.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert **equal** to **strict equal** operator. Merged to [`@putout/plugin-conditions`](https://www.npmjs.com/package/@putout/plugin-conditions).

## Install

```
npm i @putout/plugin-convert-equal-to-strict-equal -D
```

## Rule

```json
{
    "rules": {
        "convert-equal-to-strict-equal": "off"
    }
}
```

## ❌ Example of incorrect code

```js
if (a == b) {
}
```

## ✅ Example of correct code

```js
if (a === b) {
}
```

## License

MIT
npm package: @putout/plugin-convert-esm-to-commonjs
Description: 🐊Putout plugin adds ability to convert ecma script module to commonjs
Author: coderaiser
Latest version: 6.0.2

# @putout/plugin-convert-esm-to-commonjs [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-esm-to-commonjs.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-esm-to-commonjs"npm"

> **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.
>
> **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](https://parceljs.org/languages/javascript/)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert **EcmaScript Modules** to **CommonJS**. Use [`@putout/plugin-nodejs`](https://www.npmjs.com/package/@putout/plugin-nodejs) instead.

## Install

```
npm i @putout/plugin-convert-esm-to-commonjs
```

## Rule

```json
{
    "rules": {
        "convert-esm-to-commonjs": "on"
    }
}
```

## ❌ Example of incorrect code

```js
import hello from 'world';
```

## ✅ Example of correct code

```js
const hello = require('world');
```

## License

MIT
npm package: @putout/plugin-convert-expression-to-params
Description: 🐊Putout plugin adds ability to convert 'apply' to 'spread'
Author: coderaiser
Latest version: 1.0.4

# @putout/plugin-convert-expression-to-params [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-expression-to-params.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-expression-to-params "npm"

> `Uncaught SyntaxError: Malformed arrow function parameter list` occurs when your function declaration is missing valid parameters.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Missing_formal_parameter)

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to fix `SyntaxError: missing formal parameter` .
Checkout in 🐊[**Putout Editor**](https://putout.vercel.app/#/gist/e1818c2385974e136ae77eb28b3d2221/66dcb650e02aaafffa7fe00914f80366c4bfd7d3).

Merged with [@putout/plugin-arguments](@putout/plugin-arguments).

## Install

```
npm i @putout/plugin-convert-expression-to-params -D
```

## Rule

```json
{
    "rules": {
        "convert-expression-to-params": "on"
    }
}
```

## ❌ Example of incorrect code

```js
(__a, __b) => __b + __a;
(__a, __b) => __b + __a;
(__a, hello, world) => __a;
```

## ✅ Example of correct code

```js
(__a, hello, world) => __a;
(__a, __b) => __b + __a;
(__a, __b) => __b + __a;
```

## License

MIT
npm package: @putout/plugin-convert-for-each-to-for-of
Description: 🐊Putout plugin adds ability to convert 'forEach' to 'for...of'
Author: coderaiser
Latest version: 8.1.1

# @putout/plugin-convert-for-each-to-for-of [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-for-each-to-for-of.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-for-each-to-for-of "npm"

> The [`forEach()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) method executes a provided function once for each array element.
>
> The [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement creates a loop which invokes a custom iteration hook with statements to be executed for the value of each element of an array.
>
> (c) MDN

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `forEach()` to `for...of`.
Complements [`@putout/plugin-convert-const-to-let`](https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-const-to-let#readme). Merged to [`@putout/plugin-for-of`](https://www.npmjs.com/package/@putout/plugin-for-of).

## Install

```
npm i @putout/plugin-convert-for-each-to-for-of -D
```

## Rule

```json
{
    "rules": {
        "convert-for-each-to-for-of": "on"
    }
}
```

## ❌ Example of incorrect code

```js
Object.keys(json).forEach((name) => {
    manage(name, json[name]);
});

[].forEach.call(arguments, (item) => {
    console.log(item);
});
```

## ✅ Example of correct code

```js
for (const name of Object.keys(json)) {
    manage(name, json[name]);
}

for (const name of arguments) {
    console.log(item);
}
```

## License

MIT
npm package: @putout/plugin-convert-for-in-to-for-of
Description: 🐊Putout plugin adds ability to convert for-in to for-of
Author: coderaiser
Latest version: 2.0.1

# @putout/plugin-convert-for-in-to-for-of [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-for-in-to-for-of.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-for-in-to-for-of "npm"

> The [`for...in`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) statement iterates over all enumerable properties of an object that are keyed by strings.
>
> The [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement creates a loop which invokes a custom iteration hook with statements to be executed for the value of each element of an array.
>
> (c) MDN

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `for...in` to `for...of` loop. Merged to [`@putout/plugin-for-of`](https://www.npmjs.com/package/@putout/plugin-for-of).

## Install

```
npm i @putout/plugin-convert-for-in-to-for-of -D
```

## Rule

```json
{
    "rules": {
        "convert-for-in-to-for-of/positive": "on",
        "convert-for-in-to-for-of/negative": "on"
    }
}
```

## ❌ Example of incorrect code

```js
for (const item in object) {
    if (object.hasOwnProperty(item)) {
        log(item);
    }
}

for (const item in object) {
    if (!object.hasOwnProperty(item))
        continue;
    
    log(item);
}
```

## ✅ Example of correct code

```js
for (const item of Object.keys(object)) {
    log(item);
}
```

## License

MIT
npm package: @putout/plugin-convert-for-to-for-of
Description: 🐊Putout plugin adds ability to convert for to for-of
Author: coderaiser
Latest version: 4.0.2

# @putout/plugin-convert-for-to-for-of [![NPM version][NPMIMGURL]][NPMURL]

[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-for-to-for-of.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-for-to-for-of "npm"

> The [`for`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement to be executed in the loop.
>
> The [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement creates a loop which invokes a custom iteration hook with statements to be executed for the value of each element of an array.
>
> (c) MDN

🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `for` to `for...of` loop. Merged to [`@putout/plugin-for-of`](https://www.npmjs.com/package/@putout/plugin-for-of).

## Install

```
npm i @putout/plugin-convert-for-to-for-of -D
```

## Rule

```json
{
    "rules": {
        "convert-for-to-for-of/n": "on",
        "convert-for-to-for-of/length": "on",
        "convert-for-to-for-of/entries": "on"
    }
}
```


## License

MIT