Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@putout/cli-ruler

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/cli-ruler

toggle rules in .putout.json

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@putout/cli-ruler NPM version

Ruler toggler for .putout.json.

Install

npm i @putout/cli-ruler

API

To create new file .putout.json and disable all rules defined by places use:

disableAll

import {rule} from '@putout/cli-ruler';
import {
    readFile,
    writeFile,
} from 'node:fs/promises';

const places = [{
    rule: 'remove-unused-variables',
    message: '"a" is defined but never used',
    position: {
        line: 3,
        column: 6,
    },
}];

const options = {
    disableAll: true,
    readFile,
    writeFile,
};

await ruler(places, options);

It will produce .putout.json:

{
    "rules": {
        "remove-unused-variables": "off"
    }
}

Same with enableAll

enable

To enable one rule with a name remove-unused-variables use:

import ruler from '@putout/cli-ruler';
import {
    readFile,
    writeFile,
} from 'node:fs/promises';

const places = [];

const options = {
    enable: 'remove-unused-variables',
    readFile,
    writeFile,
};

await ruler(places, options);

It will produce .putout.json:

{
    "rules": {
        "remove-unused-variables": "on"
    }
}

Same with disable.

License

MIT

Keywords

FAQs

Package last updated on 27 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc