putout v27.0.0
“Man follows Earth, Earth follows Heaven. Heaven follows the Tao. Yet the Tao follows Nature. Tao produced one. One produced two. Two produced Three. Three produced ten thousand beings. Ten thousand beings carry yin and embrace yang; By blending their energies they achieve harmony. Therefore existence and nonexistence produce each other. Difficulty and ease complement each other. Long and short contrast with each other. High and low rely on each other. Sound and voice harmonize with each other. Front and back follow each other. The Tao fulfills its purpose quietly and makes no claim. When success is achieved, withdrawing. The highest good is like water. Water benefits ten thousand beings, Yet it does not contend. Nothing under Heaven is as soft and yielding as water. Yet in attacking the firm and strong, Nothing is better than water.”
(c) I Ching
Hi folks!
The time is come for the new 🐊Putout release. It has a couple breaking changes... to the point!
Introduces @putout/eslint
.
The time is come to move out all ESLint
related stuff to separate package. So if you used it make changes:
npm i @putout/eslint
-import eslint from 'putout/eslint';
+import eslint from '@putout/eslint';
And use it as before according to ESLint API.
🚪Exit Codes
Next two exit codes switched and now has next numbers:
Code | Name | Description | Example |
---|---|---|---|
9 | CANNOT_LOAD_FORMATTER |
formatter has errors | 🐊 @putout/formatter-dump: Syntax error |
13 | UNHANDLED |
unhandled exception | <unhandled exception> |
Introduced logical-expressions
From now logical-expressions
includes:
remove-boolean-from-logical-expression
convert-bitwise-to-logical
simplify-logical-expressions
remove-duplicates-from-logical-expression
If you disabled for some reason some of this rules what you need to do in your .putout.json
is:
{
"rules": {
- "remove-boolean-from-logical-expressions": "off",
- "convert-bitwise-to-logical": "off",
- "simplify-logical-expressions": "off",
- "remove-duplicates-from-logical-expressions": "off",
+ "logical-expressions/remove-boolean": "off",
+ "logical-expressions/convert-bitwise-to-logical": "off",
+ "logical-expressions/simplify": "off",
+ "logical-expressions/remove-duplicates": "off",
}
}
Now we have 3 dependencies less 🥳!
Dropped support of eslint-plugin-node
eslint-plugin-node
wasn't updated for two years, so it was forked to eslint-plugin-n
which is well supported.
Thanks a lot @aladdin-add for maintaining this fork!
eslint-plugin-putout
now uses eslint-plugin-n
as direct dependency (to have same rules disabled, for markdown files, for example). So to avoid any confusion also 🐊Putout has a major version bump with a new rule in @putout/plugin-eslint
called convert-node-to-n
:
{
"extends": [
"plugin:putout/safe+align",
- "plugin:node/recommended"
+ "plugin:n/recommended"
],
"plugins": [
"putout",
- "node"
+ "n"
]
}
All you need to do is to use nupdate tool:
nupdate putout -c;
nupdate eslint-plugin-putout -c;
nupdate eslint-plugin-n -aDc;
yarn;
putout --fix .
nupdate eslint-plugin-node -r;
git commit -am 'feature: now I have eslint-plugin-n ✅'
Also GitHub Actions benefit from this change, since it is already has an auto fix, and if only .eslintrc.json
will be updated everything will broke down 🤷♂️.
Have a nice day 🎉!
🔥 feature
- (putout) add ability to convert eslint-plugin-node to eslint-plugin-n