@putout/cli-match
v2.2.0
Published
convert "rules" section to "match" in .putout.json
Downloads
33,472
Readme
@putout/cli-match
Read .putout.json
and convert rules
into match
.
Install
npm i @putout/cli-match
{
- "rules": {
- "remove-debugger": "on"
+ "match": {
+ "*.md": {
+ "remove-debugger": "on"
+ }
}
}
Example
import {cwd} from 'node:process';
import {
readFile,
writeFile,
} from 'node:fs/promises';
import match from '@putout/cli-match';
const {code, message} = await match({
pattern,
cwd: cwd(),
readFile, // optional
writeFile, // optional
});
console.log(message); process.exit(code);
License
MIT