@putout/plugin-putout-config
putout plugin helps to maintain putout config
Last updated 4 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-putout-config 
SYNC missed versions from official npm registry.

@putout/plugin-putout-config NPM version

????Putout plugin helps with ????Putout Config.

Install

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

Rules

Config

{
    "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 according to:

{
    "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 according to:

{
    "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 according to:

{
    "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 according to:

{
    "rules": {
-       "esm/add-index-to-import": "on"
  }
}
{
    "rules": {
-       "putout/add-index-to-import": "on"
+       "esm/add-index-to-import": "on"
  }
}
{
    "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 according to:

{
    "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 according to:

{
    "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 according to:

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

apply-optional-chaining

Apply optional-chaining according to:

{
    "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 according to:

{
    "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 according to:

{
    "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 according to:

{
    "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"
  }
}
{
    "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.

Apply coverage according to:

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

apply-for-of

Apply for-of according to ????Putout v29.

{
    "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 according to ????Putout v36. Checkout in ????Putout Editor.

❌ Example of incorrect code

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

✅ Example of correct code

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

apply-math

Apply math according to ????Putout v28.

{
    "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 according to:

{
    "rules": {
-       "convert-top-level-return": "off",
+       "nodejs/convert-top-level-return": "off"
-       "remove-process-exit": "off"
+       "nodejs/remove-process-exit": "off"
    }
}
{
    "rules": {
-    "convert-esm-to-commonjs": "on",
-    "convert-commonjs-to-esm": "on'
+    "nodejs/convert-esm-to-commonjs": "on",
+    "nodejs/convert-commonjs-to-esm": "on'
    }
}
{
    "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 according to:

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

apply-tape

Apply tape according to:

❌ Example of incorrect code

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

✅ Example of correct code

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

apply-types

Apply types according to:

{
    "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

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

✅ Example of correct code

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

move-formatter-up

Checkout in ????Putout Editor.

❌ Example of incorrect code

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

✅ Example of correct code

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

remove-empty

❌ Example of incorrect code

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

✅ Example of correct code

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

remove-empty-file

Checkout in ????Putout Editor. When .putout.json content is:

{}

It has no sense and removed:

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

rename-rules

Rename rules according to:

{
    "rules": {
-       "declare-undefined-variables": "off" ,
+       "declare": "off",
-       "apply-maybe": "off" ,
+       "maybe": "off",
-       "apply-array-at": "off",
+       "apply-at": "off",
    }
}
{
    "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.

❌ Example of incorrect code

{
    "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

{
    "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

Current Tags

  • 12.3.0                                ...           latest (2 months ago)

58 Versions

  • 12.3.0                                ...           2 months ago
  • 12.2.1                                ...           2 months ago
  • 12.2.0                                ...           2 months ago
  • 12.1.0                                ...           2 months ago
  • 12.0.0                                ...           2 months ago
  • 11.14.0                                ...           2 months ago
  • 11.13.1                                ...           2 months ago
  • 11.13.0                                ...           2 months ago
  • 11.12.0                                ...           2 months ago
  • 11.11.0                                ...           3 months ago
  • 11.10.1                                ...           4 months ago
  • 11.10.0                                ...           4 months ago
  • 11.9.0                                ...           4 months ago
  • 11.8.0                                ...           4 months ago
  • 11.7.0                                ...           4 months ago
  • 11.6.0                                ...           4 months ago
  • 11.5.0                                ...           4 months ago
  • 11.4.0                                ...           4 months ago
  • 11.3.0                                ...           4 months ago
  • 11.2.0                                ...           4 months ago
  • 11.1.1                                ...           4 months ago
  • 11.1.0                                ...           4 months ago
  • 11.0.0                                ...           4 months ago
  • 10.0.0                                ...           a year ago
  • 9.0.1                                ...           a year ago
  • 9.0.0                                ...           a year ago
  • 8.1.0                                ...           a year ago
  • 8.0.0                                ...           a year ago
  • 7.3.0                                ...           a year ago
  • 7.2.0                                ...           a year ago
  • 7.1.0                                ...           a year ago
  • 7.0.1                                ...           a year ago
  • 7.0.0                                ...           a year ago
  • 6.9.3                                ...           2 years ago
  • 6.9.2                                ...           2 years ago
  • 6.9.1                                ...           2 years ago
  • 6.9.0                                ...           2 years ago
  • 6.8.0                                ...           2 years ago
  • 6.7.0                                ...           2 years ago
  • 6.6.0                                ...           2 years ago
  • 6.5.0                                ...           2 years ago
  • 6.4.0                                ...           2 years ago
  • 6.3.0                                ...           2 years ago
  • 6.2.0                                ...           2 years ago
  • 6.1.0                                ...           2 years ago
  • 6.0.0                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.2                                ...           5 years ago
  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 21
Last Month 18
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |