eslint-plugin-disallow-property

ESLint plugin for disallowing specified properties

Usage no npm install needed!

<script type="module">
  import eslintPluginDisallowProperty from 'https://cdn.skypack.dev/eslint-plugin-disallow-property';
</script>

README

eslint-plugin-disallow-property

ESLint plugin for disallowing specified properties

Usage

This plugin requires ESLint to also be installed. With both ESLint and this plugin installed, you will need to enable the plugin and configure what methods are disallowed.

Installation

Install ESLint if you have not already:

npm install eslint --save-dev

Install the plugin:

npm install eslint-plugin-disallow-property --save-dev

Configuration

Configure the plugin and its rules in your .eslintrc file or your shareable config.

Sample .eslintrc:

{
  "plugins": [
    // other plugins would go here

    "disallow-property"
  ],

  rules: {
    // other rules here

    // disallow-property rules
    "disallow-property/disallow-property": [2, ["myDisallowedProperty"]]
  }
}

Configuring rule to 1 will set it to warn and configuring it to 2 will set it to error.

License

MIT