@putout/plugin-putout-config
πPutout plugin helps with πPutout Config.
Install
npm i @putout/plugin-putout-config -D
Rules
- β
[apply-conditions][#apply-conditions];
- β
[apply-labels][#apply-labels];
- β
[apply-nodejs][#apply-nodejs];
- β
[apply-tape][#apply-tape];
- β
[convert-boolean-to-string][#convert-boolean-to-string];
- β
[move-formatter-up][#move-formatter-up];
- β
[remove-empty][#remove-empty];
- β
[rename-property.js][#rename-property.js];
Config
{
"rules": {
"putout-config/apply-conditions": "on",
"putout-config/apply-labels": "on",
"putout-config/apply-nodejs": "on",
"putout-config/convert-boolean-to-string": "on",
"putout-config/move-formatter-up": "on",
"putout-config/remove-empty": "on"
}
}
apply-conditions
Apply conditions
according to πPutout v32.
β Example of incorrect code
{
"rules": {
"remove-useless-else": "off",
"merge-if-statements": "off"
}
}
β
Example of correct code
{
"rules": {
"conditions/remove-useless-else": "off",
"conditions/merge-if-statements": "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-nodejs
Apply nodejs
according to:
β Example of incorrect code
{
"rules": {
"strict-mode/add-missing": "off",
"strict-mode/remove-useless": "off",
"convert-esm-to-commonjs": "off",
"convert-commonjs-to-esm": "off"
}
}
β
Example of correct code
{
"rules": {
"nodejs/add-missing-strict-mode": "off",
"nodejs/remove-useless-strict-mode": "off",
"nodejs/convert-esm-to-commonjs": "off",
"nodejs/convert-commonjs-to-esm": "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"
}
}
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"
}
}
}
License
MIT