{"name":"@putout/cli-ruler","version":"4.0.0","keywords":["putout","cli"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/cli-ruler@4.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/cli-ruler#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"1a184dd2b7d18365ecc03848cb792814c07cd432","tarball":"http://registry-npm.ywwl.com/@putout/cli-ruler/download/@putout/cli-ruler-4.0.0.tgz","fileCount":5,"integrity":"sha512-2lwwPRYDFptr3qkWTmEPjCTtGKlA7Vcx12j+L6R5CuoLA8D7YjT0rT9f9DVGUOIHPDWIu74mg5ZDRSC+6eji4A==","signatures":[{"sig":"MEUCIHhg25bAtW9G+QGs2SIHL0Zyb3OT5N/ZVQyLcdE7f0h6AiEAxaC/a3HK8nK60GVdQPjrbgxCORwKcEP+I5RWnWHqPvQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6089,"size":2492,"noattachment":false,"key":"/@putout/cli-ruler/-/@putout/cli-ruler-4.0.0.tgz"},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"gitHead":"6c5a14342c98f95534a23b76e5b32a0c11ea6f32","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.1.0","description":"toggle rules in .putout.json","directories":{},"_nodeVersion":"22.14.0","dependencies":{"try-to-catch":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","putout":"*","nodemon":"^3.0.1","supertape":"^11.0.3","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^26.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cli-ruler_4.0.0_1742987462408_0.6522792499338439","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/cli-ruler [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/cli-ruler.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/cli-ruler \"npm\"\n\nRuler toggler for `.putout.json`.\n\n## Install\n\n```\nnpm i @putout/cli-ruler\n```\n\n## API\n\nTo create new file `.putout.json` and disable all rules defined by `places` use:\n\n### disableAll\n\n```js\nimport {readFile, writeFile} from 'node:fs/promises';\nimport {rule} from '@putout/cli-ruler';\n\nconst places = [{\n    rule: 'remove-unused-variables',\n    message: '\"a\" is defined but never used',\n    position: {\n        line: 3,\n        column: 6,\n    },\n}];\n\nconst options = {\n    disableAll: true,\n    readFile,\n    writeFile,\n};\n\nawait ruler(places, options);\n```\n\nIt will produce `.putout.json`:\n\n```json\n{\n    \"rules\": {\n        \"remove-unused-variables\": \"off\"\n    }\n}\n```\n\nSame with `enableAll`\n\n### enable\n\nTo enable one rule with a name `remove-unused-variables` use:\n\n```js\nimport {readFile, writeFile} from 'node:fs/promises';\nimport ruler from '@putout/cli-ruler';\n\nconst places = [];\n\nconst options = {\n    enable: 'remove-unused-variables',\n    readFile,\n    writeFile,\n};\n\nawait ruler(places, options);\n```\n\nIt will produce `.putout.json`:\n\n```json\n{\n    \"rules\": {\n        \"remove-unused-variables\": \"on\"\n    }\n}\n```\n\nSame with `disable`.\n\n## License\n\nMIT\n","publish_time":1742987462723,"_cnpm_publish_time":1742987462723,"dist-tags":{"latest":"5.0.0"}}