Socket
Socket
Sign inDemoInstall

eslint-plugin-deprecation

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-deprecation

ESLint rule that reports usage of deprecated code


Version published
Weekly downloads
681K
increased by0.57%
Maintainers
1
Weekly downloads
 
Created

What is eslint-plugin-deprecation?

The eslint-plugin-deprecation package is an ESLint plugin that helps developers identify and manage deprecated code in their JavaScript projects. It allows you to mark certain functions, methods, or properties as deprecated and provides warnings or errors when they are used.

What are eslint-plugin-deprecation's main functionalities?

Detect Deprecated Functions

This feature allows you to specify deprecated functions and provide a custom message. When the deprecated function is used, ESLint will warn the developer.

module.exports = {
  rules: {
    'deprecation/deprecation': [
      'warn',
      {
        'methods': {
          'myDeprecatedFunction': 'This function is deprecated. Use newFunction instead.'
        }
      }
    ]
  }
};

Detect Deprecated Properties

This feature allows you to mark object properties as deprecated. When the deprecated property is accessed, ESLint will issue a warning.

module.exports = {
  rules: {
    'deprecation/deprecation': [
      'warn',
      {
        'properties': {
          'myObject.oldProperty': 'This property is deprecated. Use newProperty instead.'
        }
      }
    ]
  }
};

Custom Deprecation Messages

This feature allows you to provide custom deprecation messages for both methods and properties, giving developers clear guidance on what to use instead.

module.exports = {
  rules: {
    'deprecation/deprecation': [
      'warn',
      {
        'methods': {
          'oldFunction': 'oldFunction is deprecated. Please use newFunction.'
        },
        'properties': {
          'oldProperty': 'oldProperty is deprecated. Please use newProperty.'
        }
      }
    ]
  }
};

Other packages similar to eslint-plugin-deprecation

FAQs

Package last updated on 27 Jul 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