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

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

🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with 🐊[**Putout Config**](https://github.com/coderaiser/putout#-configuration).

## Install

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

## Rules

- ✅ [apply-arguments](#apply-arguments);
- ✅ [apply-assignment](#apply-assignment);
- ✅ [apply-conditions](#apply-conditions);
- ✅ [apply-coverage](#apply-coverage);
- ✅ [apply-destructuring](#apply-destructuring);
- ✅ [apply-esm](#apply-esm);
- ✅ [apply-filesystem](#apply-filesystem);
- ✅ [apply-for-of](#apply-for-of);
- ✅ [apply-parens](#apply-parens);
- ✅ [apply-return](#apply-return);
- ✅ [apply-spread](#apply-spread);
- ✅ [apply-labels](#apply-labels);
- ✅ [apply-math](#apply-math);
- ✅ [apply-nodejs](#apply-nodejs);
- ✅ [apply-optional-chaining](#apply-optional-chaining);
- ✅ [apply-promises](#apply-promises);
- ✅ [apply-tape](#apply-tape);
- ✅ [apply-types](#apply-types);
- ✅ [apply-variables](#apply-variables);
- ✅ [convert-boolean-to-string](#convert-boolean-to-string);
- ✅ [move-formatter-up](#move-formatter-up);
- ✅ [remove-empty](#remove-empty);
- ✅ [remove-empty-file](#remove-empty-file);
- ✅ [rename-property](#rename-property);
- ✅ [rename-rules](#rename-rules);
- ✅ [sort-ignore](#sort-ignore);

## Config

```json
{
    "rules": {
        "putout-config/apply-arguments": "on",
        "putout-config/apply-assignment": "on",
        "putout-config/apply-conditions": "on",
        "putout-config/apply-coverage": "on",
        "putout-config/apply-destructuring": "on",
        "putout-config/apply-esm": "on",
        "putout-config/apply-for-of": "on",
        "putout-config/apply-filesystem": "on",
        "putout-config/apply-labels": "on",
        "putout-config/apply-math": "on",
        "putout-config/apply-nodejs": "on",
        "putout-config/apply-optional-chaining": "on",
        "putout-config/apply-parens": "on",
        "putout-config/apply-promises": "on",
        "putout-config/apply-return": "on",
        "putout-config/apply-spread": "on",
        "putout-config/apply-tape": "on",
        "putout-config/apply-types": "on",
        "putout-config/apply-variables": "on",
        "putout-config/convert-boolean-to-string": "on",
        "putout-config/move-formatter-up": "on",
        "putout-config/remove-empty": "on",
        "putout-config/remove-empty-file": "off",
        "putout-config/rename-rules": "on",
        "putout-config/sort-ignore": "on"
    }
}
```

## apply-assignment

Apply [`assignment`](https://github.com/coderaiser/putout/tree/master/packages/plugin-assignment#readme) according to:

- 🐊[**Putout v39**](https://github.com/coderaiser/putout/releases/tag/v39.0.0):

```diff
{
    "rules": {
-       "split-assignment-expressions": "off",
-       "simplify-assignments": "off",
-       "convert-assignment-to-arrow-function": "off",
-       "convert-assignment-to-comparison": "off",
-       "convert-assignment-to-declaration": "off"
+       "assignment/split": "off",
+       "assignment/simplify": "off",
+       "assignment/convert-to-arrow-function": "off"
+       "assignment/convert-to-comparison": "off",
+       "assignment/convert-to-declaration": "off"
  }
}
```

## apply-return

Apply [`return`](https://github.com/coderaiser/putout/tree/master/packages/plugin-return#readme) according to:

- 🐊[**Putout v38**](https://github.com/coderaiser/putout/releases/tag/v38.0.0):

```diff
{
    "rules": {
-       "apply-early-return": "off",
+       "return/apply-early": "off",
-       "simplify-boolean-return": "off",
+       "return/simplify-boolean": "off",
-       "convert-break-to-return": "off",
+       "return/convert-from-break": "off"
-       "remove-useless-return": "off"
+       "return/remove-useless": "off"
  }
}
```

## apply-filesystem

Apply [`filesystem`](https://github.com/coderaiser/putout/tree/master/packages/plugin-filesystem#readme) according to:

- 🐊[**Putout v42**](https://github.com/coderaiser/putout/releases/tag/v42.0.0):

```diff
{
    "rules": {
-       "filesystem/remove-travis-yml-file": "off",
-       "filesystem/remove-vim-swap-file": "off",
-       "filesystem/remove-nyc-output-file": "off",
-       "filesystem/remove-ds-store-file": "off",
-       "filesystem/remove-empty-directory": "off",
+       "filesystem/remove-files": "off",
  }
}
```

## apply-esm

Apply [`esm`](https://github.com/coderaiser/putout/tree/master/packages/plugin-esm#readme) according to:

- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):

```diff
{
    "rules": {
-       "esm/add-index-to-import": "on"
  }
}
```

- 🐊[**Putout v40**](https://github.com/coderaiser/putout/releases/tag/v40.0.0):

```diff
{
    "rules": {
-       "putout/add-index-to-import": "on"
+       "esm/add-index-to-import": "on"
  }
}
```

- 🐊[**Putout v37**](https://github.com/coderaiser/putout/releases/tag/v37.0.0):

```diff
{
    "rules": {
-       "remove-empty/import": "on",
-       "remove-empty/export": "on",
+       "esm/remove-empty-import": "on",
+       "esm/remove-empty-export": "on",
-       "convert-assert-to-with": "off",
-       "group-imports-by-source": "on",
-       "declare-imports-first": "on",
-       "remove-quotes-from-import-assertions": "on",
-       "merge-duplicate-imports": "on",
-       "sort-imports-by-specifiers": "on"
+       "esm/convert-assert-to-with": "off",
+       "esm/group-imports-by-source": "on",
+       "esm/declare-imports-first": "on",
+       "esm/remove-quotes-from-import-assertions": "on",
+       "esm/merge-duplicate-imports": "on",
+       "esm/sort-imports-by-specifiers": "on"
  }
}
```

## apply-arguments

Apply [`arguments`](https://github.com/coderaiser/putout/tree/master/packages/plugin-arguments#readme) according to:

- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):

```diff
{
    "rules": {
-       "remove-useless-arguments": "off",
-       "remove-useless-arguments/arguments": "on",
-       "convert-expression-to-params": "on",
-       "remove-useless-arguments/method": "on",
-       "remove-useless-arguments/unused": "on",
-       "remove-useless-arguments/json-parse": "on"
-       "convert-arguments-to-rest": "off"
+       "arguments": "off",
+       "arguments/apply-json-parse": "on",
+       "arguments/apply-rest": "on",
+       "arguments/convert-expression-to-arguments": "on",
+       "arguments/remove-useless": "on",
+       "arguments/remove-useless-from-method": "on",
+       "arguments/remove-unused": "on"
  }
}
```

## apply-destructuring

Apply [`destructuring`](https://github.com/coderaiser/putout/tree/master/packages/plugin-destructuring#readme) according to:

- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):

```diff
{
    "rules": {
-       "apply-destructuring": "off",
-       "apply-destructuring/falsy": "off",
-       "apply-destructuring/array": "off",
-       "apply-destructuring/object": "off",
-       "apply-destructuring/convert-object-to-array": "off",
-       "split-call-with-destructuring": "off",
-       "merge-destructuring-properties": "off",
-       "split-nested-destructuring": "off",
-       "remove-useless-arguments/destructuring": "off",
-       "remove-useless-variables/destruct": "off",
-       "extract-object-properties": "off",
-       "extract-object-properties/equal-deep": "off",
-       "extract-object-properties/not-equal-deep": "off",
+       "destructuring": "off",
+       "destructuring/remove-useless-object": "off",
+       "destructuring/apply-array": "off",
+       "destructuring/apply-object": "off",
+       "destructuring/convert-object-to-array": "off",
+       "destructuring/split-call": "off",
+       "destructuring/merge-properties": "off",
+       "destructuring/split-nested": "off",
+       "destructuring/remove-useless-arguments": "off",
+       "destructuring/remove-useless-variables": "off"
+       "destructuring/extract-properties": "off",
+       "desturucturing/extract-properties-equal-deep": "off",
+       "destructurigin/extract-properties-not-equal-deep": "off",
  }
}
```

## apply-parens

Apply [`parens`](https://github.com/coderaiser/putout/tree/master/packages/plugin-parens#readme) according to:

- 🐊[**Putout v37**](https://github.com/coderaiser/putout/releases/tag/v37.0.0):

```diff
{
    "rules": {
-       "add-missing-parens": "on"
+       "parens/add-missing": "on"
  }
}
```

## apply-optional-chaining

Apply [`optional-chaining`](https://github.com/coderaiser/putout/tree/master/packages/plugin-optional-chaining#readme) according to:

- 🐊[**Putout v37**](https://github.com/coderaiser/putout/releases/tag/v37.0.0):

```diff
{
    "rules": {
-       "convert-optional-to-logical/assign": "on",
-       "convert-optional-to-logical/call": "off",
+       "optional-chaining/convert-optional-assign-to-logical": "on",
+       "optional-chaining/convert-optional-to-logical": "off"
-       "apply-optional-chaining/assign": "off"
-       "apply-optional-chaining/use": "on"
+       "optional-chaining/convert-logical-assign-to-optional": "off",
+       "optional-chaining/convert-logical-to-optional": "off"
  }
}
```

## apply-spread

Apply [`spread`](https://github.com/coderaiser/putout/tree/master/packages/plugin-spread#readme) according to:

- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):

```diff
{
    "rules": {
-       "remove-useless-spread": "on",
-       "remove-useless-spread/array": "on",
-       "remove-useless-spread/object": "on",
-       "remove-useless-spread/nested": "on",
-       "convert-apply-to-spread": "on"
-       "convert-object-assign-to-merge-spread": "on"
+       "spread": "on",
+       "spread/remove-useless-array": "on",
+       "spread/remove-useless-object": "on",
+       "spread/simplify-nested": "on",
+       "spread/convert-apply-to-spread": "on",
+       "spread/convert-object-assign-to-merge-spread": "on"
  }
}
```

## apply-variables

Apply [`variables`](https://github.com/coderaiser/putout/tree/master/packages/plugin-variables#readme) according to:

- 🐊[**Putout v41**](https://github.com/coderaiser/putout/releases/tag/v41.0.0):

```diff
{
    "rules": {
-       "remove-useless-variables": "off",
-       "remove-unused-variables": "on",
-       "remove-useless-variables/remove": "on",
-       "remove-useless-variables/assignment": "on",
-       "remove-useless-arguments/declaration": "on",
-       "remove-useless-arguments/duplicate": "on",
-       "remove-useless-arguments/rename": "on",
-       "remove-unreferenced-variables": "on",
-       "convert-const-to-let": "on",
-       "extract-keyword-from-variables": "on"
-       "split-variable-declarations: "on",
-       "reuse-duplicate-init: "on",
+       "variables": "off",
+       "variables/remove-unused": "on",
+       "variables/remove-useless": "on",
+       "variables/remove-useless-assignment": "on",
+       "variables/remove-useless-declarations": "on",
+       "variables/remove-useless-duplicates": "on",
+       "variables/remove-useless-rename": "on",
+       "variables/remove-unreferenced": "on",
+       "variables/convert-const-to-let": "on"
+       "variables/extract-keyword": "on"
+       "variables/split-declarations: "on",
+       "variables/reuse-duplicate-init: "on"
  }
}
```

## apply-conditions

Apply [`conditions`](https://github.com/coderaiser/putout/tree/master/packages/plugin-conditions#readme) according to:

- 🐊[**Putout v29**](https://github.com/coderaiser/putout/releases/tag/v29.0.0):

```diff
{
    "rules": {
-       "apply-comparison-order": "off" ,
-       "apply-if-condition": "off",
-       "convert-comparison-to-boolean": "off",
-       "convert-equal-to-strict-equal": "off",
-       "remove-useless-conditions/evaluate": "off",
-       "remove-useless-conditions/simplify": "off",
-       "convert-comparison-to-boolean": "off",
-       "remove-constant-conditions": "off",
-       "remove-boolean-from-assertions": "off",
+       "conditions/apply-comparison-order": "off",
+       "conditions/apply-if": "off",
+       "conditions/convert-comparison-to-boolean": "off",
+       "conditions/convert-equal-to-strict-equal": "off",
+       "conditions/evaluate": "off"
+       "conditions/simplify": "off",
+       "conditions/convert-comparison-to-boolean": "off",
+       "conditions/remove-constant": "off",
+       "conditions/remove-boolean": "off"
  }
}
```

- 🐊[**Putout v32**](https://github.com/coderaiser/putout/releases/tag/v32.0.0):

```diff
{
    "rules": {
-        "remove-useless-else": "off",
-        "merge-if-statements": "off"
+        "conditions/remove-useless-else": "off",
+        "conditions/merge-if-statements": "off"
    }
}
```

## apply-coverage

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/5c661e8f319d6eba7185dfcc7b91d57c/db082d172b8fb896a3f608569c323c3ac0c36ef3).

Apply [`coverage`](https://github.com/coderaiser/putout/tree/master/packages/plugin-coverage#readme) according to:

- 🐊[**Putout v42**](https://github.com/coderaiser/putout/releases/tag/v42.0.0):

```diff
{
    "rules": {
-       "filesystem/remove-nyc-output": "off"
+       "coverage/remove-files": "off"
    }
  }
}
```

## apply-for-of

Apply [`for-of`](https://github.com/coderaiser/putout/tree/master/packages/plugin-for-of#readme) according to 🐊[**Putout v29**](https://github.com/coderaiser/putout/releases/tag/v29.0.0).

```diff
{
    "rules": {
-       "convert-for-to-for-of": "off",
-       "convert-for-each-to-for-of": "off",
-       "convert-for-in-to-for-of": "off",
-       "convert-map-to-for-of": "off",
-       "remove-useless-for-of": "off",
-       "remove-unused-for-of-variables": "off",
-       "remove-useless-array-from": "off",
-       "remove-useless-variables/for-of": "off"
-       "convert-reduce-to-for-of": "off",
+       "for-of/for": "off",
+       "for-of/for-each": "off",
+       "for-of/for-in": "off",
+       "for-of/map": "off",
+       "for-of/remove-useless": "off",
+       "for-of/remove-unused-variables": "off",
+       "for-of/remove-useless-array-from": "off",
+       "for-of/remove-useless-variables": "off",
+       "for-of/reduce": "off"
    }
}
```

## apply-labels

Apply [`labels`](https://github.com/coderaiser/putout/tree/master/packages/plugin-labels#readme) according to 🐊[**Putout v36**](https://github.com/coderaiser/putout/releases/tag/v36.0.0). Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/9a3493fedfafdb25e86cf76af69dd003/8678f3b271ee6f6d13bceeedbe3b143f34be9f55).

### ❌ Example of incorrect code

```json
{
    "rules": {
        "remove-unused-labels": "on",
        "convert-label-to-object": "on"
    }
}
```

### ✅ Example of correct code

```json
{
    "rules": {
        "labels/remove-unused": "on",
        "labels/convert-to-object": "on"
    }
}
```

## apply-math

Apply [`math`](https://github.com/coderaiser/putout/tree/master/packages/plugin-labels#readme) according to 🐊[**Putout v28**](https://github.com/coderaiser/putout/releases/tag/v28.0.0).

```diff
{
    "rules": {
-        "convert-math-pow": "off",
-        "apply-numeric-separators": "off",
-        "convert-imul-to-multiplication": "off",
-        "convert-sqrt-to-hypot": "off"
+        "math/apply-exponential": "off",
+        "math/apply-numeric-separators": "off",
+        "math/apply-multiplication": "off",
+        "math/convert-sqrt-to-hypot": "off"
    }
}
```

## apply-nodejs

Apply [`nodejs`](https://github.com/coderaiser/putout/tree/master/packages/plugin-nodejs#readme) according to:

- 🐊[**Putout v28**](https://github.com/coderaiser/putout/releases/tag/v33.0.0):

```diff
{
    "rules": {
-       "convert-top-level-return": "off",
+       "nodejs/convert-top-level-return": "off"
-       "remove-process-exit": "off"
+       "nodejs/remove-process-exit": "off"
    }
}
```

- 🐊[**Putout v33**](https://github.com/coderaiser/putout/releases/tag/v33.0.0):

```diff
{
    "rules": {
-    "convert-esm-to-commonjs": "on",
-    "convert-commonjs-to-esm": "on'
+    "nodejs/convert-esm-to-commonjs": "on",
+    "nodejs/convert-commonjs-to-esm": "on'
    }
}
```

- 🐊[**Putout v34**](https://github.com/coderaiser/putout/releases/tag/v34.0.0):

```diff
{
    "rules": {
-       "strict-mode/add-missing": "off",
-       "strict-mode/remove-useless": "off"
+       "nodejs/remove-useless-strict-mode": "off",
+       "nodejs/add-missing-strict-mode": "off"
}
```

## apply-promises

Apply [`promises`](https://github.com/coderaiser/putout/tree/master/packages/plugin-promises#readme) according to:

- 🐊[**Putout v30**](https://github.com/coderaiser/putout/releases/tag/v30.0.0);

```diff
{
    "rules": {
-       "remove-useless-variables/await": "off",
+       "promises/remove-useless-variables": "off"
    }
}
```

## apply-tape

Apply [`tape`](https://github.com/coderaiser/putout/tree/master/packages/plugin-tape#readme) according to:

- 🐊[**Putout v33**](https://github.com/coderaiser/putout/releases/tag/v33.0.0);

### ❌ Example of incorrect code

```json
{
    "rules": {
        "convert-mock-require-to-mock-import": "off"
    }
}
```

### ✅ Example of correct code

```json
{
    "rules": {
        "tape/convert-mock-require-to-mock-import": "off"
    }
}
```

## apply-types

Apply [`types`](https://github.com/coderaiser/putout/tree/master/packages/plugin-types#readme) according to:

- 🐊[**Putout v29**](https://github.com/coderaiser/putout/releases/tag/v29.0.0);

```diff
{
    "rules": {
-       "convert-typeof-to-is-type": "off" ,
-       "remove-useless-type-conversions": "off",
-       "remove-useless-typeof": "off",
-       "apply-is-array": "off",
-       "remove-useless-type-conversion/with-double-negations": "off",
+       "types/convert-typeof-to-is-type": "off",
+       "types/remove-useless-conversion": "off",
+       "types/remove-double-negations": "off",
+       "types/remove-useless-typeof": "off",
+       "types/apply-is-array": "off",
+       "types/remove-double-negations": "off"
  }
}
```

## convert-boolean-to-string

### ❌ Example of incorrect code

```json
{
    "rules": {
        "remove-unused-variables": true,
        "remove-debugger": false
    }
}
```

### ✅ Example of correct code

```json
{
    "rules": {
        "remove-unused-variables": "on",
        "remove-debugger": "off"
    }
}
```

## move-formatter-up

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/48ce05b358a9118250acdc0b35df0fc8/50aeb680193ab4cd5d247e098ff90be8d4092111).

### ❌ Example of incorrect code

```json
{
    "parser": "babel",
    "rules": {
        "remove-unused-variables": "off"
    },
    "formatter": "progress-bar"
}
```

### ✅ Example of correct code

```json
{
    "parser": "babel",
    "formatter": "progress-bar",
    "rules": {
        "remove-unused-variables": "off"
    }
}
```

## remove-empty

### ❌ Example of incorrect code

```json
{
    "rules": {},
    "plugins": [],
    "match": {
        "*.js": {
            "remove-unused-variables": "off"
        }
    }
}
```

### ✅ Example of correct code

```json
{
    "match": {
        "*.js": {
            "remove-unused-variables": "off"
        }
    }
}
```

## remove-empty-file

Checkout in 🐊[**Putout Editor**](https://putout.vercel.app/#/gist/3d4878a71fe3fe5a2676b2f1380bad2e/071b8db5c4c8e00f73b2d6d3ded040d0d64d2977).
When `.putout.json` content is:

```json
{}
```

It has no sense and removed:

```diff
 /
 `-- /
-     `-- .putout.json
```

## rename-rules

Rename rules according to:

- 🐊[**Putout v29**](https://github.com/coderaiser/putout/releases/tag/v29.0.0):

```diff
{
    "rules": {
-       "declare-undefined-variables": "off" ,
+       "declare": "off",
-       "apply-maybe": "off" ,
+       "maybe": "off",
-       "apply-array-at": "off",
+       "apply-at": "off",
    }
}
```

- 🐊[**Putout v26**](https://github.com/coderaiser/putout/releases/tag/v26.0.0):

```diff
{
    "rules": {
-       "strict-mode/add": "off",
-       "strict-mode/remove": "off",
+       "strict-mode/add-missing": "off",
+       "strict-mode/remove-useless": "off",
    }
}
```

## sort-ignore

Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/666cce88ac86337d2a1adc4228077da3/2514cd7df364a12eae4add32e683aad2c5bc1a2e).

### ❌ Example of incorrect code

```json
{
    "ignore": [
        "node_modules",
        "fixture",
        ".nyc_output",
        ".yarn",
        "yarn.lock",
        "yarn-error.log",
        ".pnp.*",
        "coverage",
        "dist",
        "dist-dev",
        "build",
        "package-lock.json",
        ".idea",
        ".git"
    ]
}
```

### ✅ Example of correct code

```json
{
    "ignore": [
        ".nyc_output",
        ".yarn",
        ".pnp.*",
        ".idea",
        ".git",
        "yarn.lock",
        "yarn-error.log",
        "package-lock.json",
        "node_modules",
        "fixture",
        "coverage",
        "dist",
        "dist-dev",
        "build"
    ]
}
```

## License

MIT
