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"
]
}
Rules
{
"rules": {
"madrun/add-function": true,
"madrun/add-fix-lint": true,
"madrun/call-run": true,
"madrun/convert-run-argument": true,
"madrun/rename-series-to-run": true,
"madrun/rename-eslint-to-putout": true,
}
}
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-madrun-to-lint
❌ Incorrect code example
module.exports = {
'lint': () => `eslint lib test --ignore-pattern test/fixture`,
};
✅ Correct code Example
module.exports = {
'lint': () => `eslint lib test madrun.js --ignore-pattern test/fixture`,
};
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',
};
License
MIT