Repository navigation
Putout v39
उभयोर्भावयोर्ज्ञाने ध्यात्वा मध्यं समाश्रयेत् ।
युगपच्च द्वयं त्यत्क्त्वा मध्ये तत्त्वं प्रकाशते ॥ ६१ ॥ubhayorbhāvayorjñāne dhyātvā madhyaṃ samāśrayet |
yugapacca dvayaṃ tyatktvā madhye tattvaṃ prakāśate || 61 ||One should think of two objects, and in the event of such knowledge being matured,
then cast both aside and dwell (on the gap or space)
in the middle. Having meditated in the middle, the experience of the essence arises.
Hi folks 🦔!
The time is come for a new major release of 🐊Putout. It has a couple breaking changes and new features.
📛 Drop support of node < 20
Node v18 will be EOL in a month, and node v20 has (at least) one good feature: ability to require(esm)! It means that now all 🐊Putout plugins can be in ESM, and use import and export instead of module.exports and require.
Some plugins already in ESM, but one thing that stopped from total migrating is the need to support eslint-plugin-putout and use 🐊Putout in all IDE's that supports ESLint. Since ESLint is CommonJS it was (almost) not possible. And now it just works 🎉.
📛 Introduced @putout/plugin-assignment
Apply assignment now used instead of 5 independent plugins:
{
"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"
}
}As always, putout-config/apply-assignment got you covered 😏.
📛 Drop support of esm preset in eslint-plugin-putout
Now you can just use any other template:
- ✅ safe;
- ✅ safeAlign;
- ✅ recommended;
No need for esm it will just work 😏.
🔥 Partially disable nested rules from plugin
Let's suppose you want to use @putout/plugin-nodejs, you add it to your .putout.json:
{
"plugins": [
"nodejs
]
}And have all rules enabled (actually that is default). And you want only one rule from this plugin. How to achieve that?
It was not possible without mention all the rules and setting them to off.
Let's suppose you want to enable only nodejs/declare you can disable all the nested rules, and enable only what needed.
What you should do is:
{
"rules": {
"nodejs/add-node-prefix": "off",
"nodejs/convert-buffer-to-buffer-alloc": "off",
"nodejs/convert-fs-promises": "off",
"nodejs/convert-promisify-to-fs-promises": "off",
"nodejs/convert-dirname-to-url": "off",
"nodejs/convert-exportst-to-module-exports": "off",
"nodejs/convert-url-to-dirname": "off",
"nodejs/convert-top-level-return": "off",
"nodejs/declare": "on",
"nodejs/declare-after-require": "off",
"nodejs/group-require-by-id": "off",
"nodejs/remove-process-exit": "off",
"nodejs/add-missing-strict-mode": "off",
"nodejs/remove-useless-strict-mode": "off",
"nodejs/remove-illegal-strict-mode": "off",
"nodejs/remove-useless-promisify": "off"
},
"plugins": [
"nodejs"
]
}And that is not a problem since most rules are useful, and it is unlikely that you will need to disable all of them. But! If you want, now you can do it in a much simpler and shorter way!
{
"rules": {
"nodejs": "off",
"nodejs/declare": "on"
},
"plugins": [
"nodejs"
]
}That's all for today, have fun 🦏!
🐞 fix
- be67064 @putout/plugin-madrun: add-function: report
- 6ba9abf @putout/operator-filesystem: removeEmptyDirectory: root
- d987971 @putout/plugin-putout: apply-report: template
🔥 feature
- 16f2974 putout: @putout/plugin-montag v4.0.0
- dca9ff3 putout: @putout/plugin-github v15.0.0
- 953e1f0 @putout/plugin-github: set-node-versions: report
- 465424b putout: drop support of node < 20
- 87b73ce @putout/eslint-config: drop support of node < 20
- be11bae @putout/eslint-config: object-shorthand: dissable, use apply-shorthand-properties instead
- b0f2809 eslint-plugin-putout: drop support of node < 20
- b75f471 @putout/plugin-github: convert to ESM
- 2477c3f @putout/plugin-github: drop support of node < 20
- ef38ba0 @putout/plugin-montag: convert to ESM
- fb6b837 eslint-plugin-putout: get rid of esm preset
- fae1286 @putout/engine-loader: rules: parse-rules: get rid of condition
- 2238f28 @putout/engine-loader: add ability to disable all rules except couple enabled
- 33d1f13 @putout/plugin-filesystem: remove-empty-directory: add
- 9b0fa1e @putout/engine-runner: replace: initialize match once
- 44a8310 @putout/plugin-putout: declare: removeEmptyDirectory
- 9975fe8 @putout/operator-filesystem: property: move out
- 78c27f3 @putout/operator-filesystem: removeEmptyDirectory: add
