@putout/plugin-madrun

putout
plugin adds ability to fix issues with madrun config file.
Install
npm i putout @putout/plugin-madrun -D
Add .putout.json
with:
{
"plugins": {
"madrun": "on"
}
}
Rules
{
"rules": {
"madrun/add-function": "on",
"madrun/add-fix-lint": "on",
"madrun/add-fresh-lint": "on",
"madrun/add-run": "on",
"madrun/call-run": "on",
"madrun/convert-run-argument": "on",
"madrun/rename-series-to-run": "on",
"madrun/rename-eslint-to-putout": "on",
"madrun/set-lint-dot": "on",
"madrun/convert-to-async": "on"
}
}
add-function
❌ Incorrect code example
module.exports = {
hello: 'world',
};
✅ Correct code Example
module.exports = {
hello: () => 'world',
};
add-fix-lint
❌ Incorrect code example
const {run} = require('madrun');
module.exports = {
lint: 'putout lib test',
};
✅ Correct code Example
const {run} = require('madrun');
module.exports = {
'lint': 'putout lib test',
'fix:lint': run('lint', '--fix'),
};
add-fresh-lint
❌ Incorrect code example
const {run} = require('madrun');
module.exports = {
lint: 'putout lib test',
};
✅ Correct code Example
const {run} = require('madrun');
module.exports = {
'lint': 'putout lib test',
'fresh:lint': run('lint', '--fresh'),
'lint:fresh': run('lint', '--fresh'),
};
add-run
❌ Incorrect code example
module.exports = {
lint: 'putout lib test',
};
✅ Correct code Example
const {run} = require('madrun');
module.exports = {
lint: 'putout lib test',
};
convert-run-argument
❌ Incorrect code example
module.exports = {
hello: () => run(['a']),
};
✅ Correct code Example
module.exports = {
hello: () => run('a'),
};
rename-eslint-to-putout
❌ Incorrect code example
module.exports = {
lint: 'eslint lib test --ignore test/fixture',
};
✅ Correct code Example
module.exports = {
lint: 'putout lib test',
};
set-lint-dot
❌ Incorrect code example
module.exports = {
lint: 'putout lib test',
};
✅ Correct code Example
module.exports = {
lint: 'putout .',
};
convert-to-async
❌ Incorrect code example
module.exports = {
lint: () => String(run('hello')),
};
✅ Correct code Example
module.exports = {
lint: async () => String(await run('hello')),
};
License
MIT