Releases: coderaiser/putout
putout v42.0.3
putout v42.0.2
putout v42.0.1
Putout v42
नित्य आत्माव्यय: शुद्ध: सर्वग: सर्ववित्पर: ।
धत्तेऽसावात्मनो लिङ्गं मायया विसृजन्गुणान् ॥ २२ ॥nitya ātmāvyayaḥ śuddhaḥ
sarvagaḥ sarva-vit paraḥ
dhatte ’sāv ātmano liṅgaṁ
māyayā visṛjan guṇānThe spirit soul, the living entity, has no death, for he is eternal and inexhaustible. Being free from material contamination, he can go anywhere in the material or spiritual worlds. He is fully aware and completely different from the material body, but because of being misled by misuse of his slight independence, he is obliged to accept subtle and gross bodies created by the material energy and thus be subjected to so-called material happiness and distress. Therefore, no one should lament for the passing of the spirit soul from the body.
Hi folks 🎈!
The time is come for a new major release of 🐊Putout. This release has a couple breaking changes and some new features, so get a cup with hot tea ☕️, enjoy reading!
📛 @putout/filesystem a bit simplified
@putout/filesystem a bit simplified:
{
"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",
}
}It is handled by @putout/plugin-putout-config 😏.
📛 Dropped support of ESLint < v10
eslint-plugin-putout requires ESLint >= v10
it is just released, so is better to upgrade.
Babel also already supports it.
@putout/operator-remove-files
Welcome new operator in a hood!
When you need to create a new plugin for RedLint that removes some kind of files just use:
import {operator} from 'putout';
const {removeFiles} = operator;
export const {
report,
fix,
scan,
} = removeFiles(['.DS_Store']);@putout/operator-sort-ignore
When you need to sort things up
ignore
from:
node_modules
*.swp
yarn-error.log
yarn.lock
.idea
.DS_Store
deno.lock
coverage
.filesystem.jsonto:
.idea
.filesystem.json
.DS_Store
*.swp
yarn-error.log
yarn.lock
deno.lock
node_modules
coverageuse:
import {operator} from 'putout';
const {sortIgnore} = operator;
export const {
report,
fix,
traverse,
} = sortIgnore({
name: '.gitignore',
});json
And to sort up JSON:
{
"ignore": [
"**/package-lock.json",
"**/*.lock",
"**/.git",
"**/*.log",
"**/node_modules"
]
}to
{
"ignore": [
"**/*.lock",
"**/*.log",
"**/.git",
"**/package-lock.json",
"**/node_modules"
],
}Use:
import {operator} from 'putout';
const {sortIgnore, __json} = operator;
export const {
report,
fix,
traverse,
} = sortIgnore({
name: '.gitignore',
type: __json,
property: 'ignore',
});Totally ESM
🐊Putout now 100% ESM, since it is:
Linter that do not afraid to act like codemod
With help of:
You can migrate any kind of JavaScript codebase from CommonJS to ESM.
Here is the algorithm:
- Change
typeof yourpackage.jsonfromcommonjstomodule; - Run
putout --fix ., it will fix any code that usesrequireandmodule.exportstoimportandexport; - Run
redlint fix, it will resolve import names and changeimport {readFile} from './reader' toimport {readFile} from './reader.js`;
That's it!
If you avoid any kinds of hacks, like:
using mock-require:
❌ Example of incorrect code
// mock modules worked in CommonJS, but not in ESM
mockRequire('fs', {
readFile,
});
run(code);✅ Example of correct code
// use dependency injection instead
run(code, {
readFile
});using same names for exported and internal functions:
❌ Example of incorrect code
// 'run' already declared so we cannot just use 'const run = () => {run();}'
module.exports.run = () => {
return run();
};
function run() {
}✅ Example of correct code
// easy to migrate to `export const run = () => {return runAll();}`, since no overlap with names
module.exports.run = () => {
return runAll();
};
function runAll() {
}and reserved words
❌ Example of incorrect code
// 'delete is reserved word, you cannot use it to name variable `export const delete = () => {}`
module.exports.delete = () => {};✅ Example of correct code
// it would be 'export const remove = () => {}`, so no problem at all
module.exports.remove = () => {}If you check your code before migration, or a bit fix after migration to avoid such patterns, it will be much easier!
Any ways 🐊Putout always here to help you with any kind of your migrations 😏.
That's all for today, have a nice evening 🐈!
🔥 feature
- 6e5593b root: eslint-plugin-putout v31.0.0
- 2b07e47 putout: @putout/engine-runner v28.0.0
- befa4fe @putout/engine-runner: @putout/plugin-filesystem v13.0.0
- 489ba89 eslint-plugin-putout: @putout/eslint-config v14.0.0
- b9c7dff eslint-plugin-putout: drop support of 🐊 < 42
- c645ea2 putout: @putout/plugin-putout v29.0.0
- 04562f1 @putout/plugin-putout: drop support of 🐊 < 42
- 4404672 putout: @putout/plugin-putout-config v12.0.0
- fe7d380 putout: @putout/plugin-filesystem v13.0.0
- c65d949 @putout/eslint-config: drop support of eslint < 10
- cc19c8d @putout/eslint-config: no-dupe-keys -> remove-duplicate-keys
- 0a3ddfe @putout/plugin-filesystem: drop support of 🐊 < 42
- fac5e2e @putout/plugin-putout-config: drop support of 🐊 < 42
- b0add92 @putout/plugin-apply-filesystem: add
- 874547f putout: config: ignore: coverage -> coverage/*
- 427d4be @putout/plugin-filesystem: remove-files: merge
- 0a8182a @putout/operator-remove-files: add dismiss
- 2b92e54 @putout/operator-filesystem: findFile: array -> avoid duplications
- 56caf89 @putout/operator-remove-files: add
- 5cfbfaf eslint-plugin-putout: rm eslint-v10/babel
putout v41.25.1
putout v41.25.0
putout v41.24.0
🐞 fix
🔥 feature
putout v41.23.0
putout v41.22.0
🔥 feature
- 01f953a putout: @putout/plugin-gitignore v7.0.0
- e52061c @putout/plugin-gitignore: drop support of 🐊 < 41
- 138113a putout: @putout/plugin-npmignore v7.0.0
- da43ad1 putout: @putout/plugin-coverage v2.0.0
- 0225122 putout: @putout/operator-ignore v6.0.0
- edd6530 @putout/plugin-converage: drop support of 🐊 < 41
- 156c2ed @putout/operator-ignore: type
- e6b311e @putout/plugin-simplify-ternary: isFn