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 - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

dist/eslint-plugin-deprecation-1.3.3.tgz

22

dist/rules/deprecation.js

@@ -48,5 +48,15 @@ "use strict";

return function identifierRule(id) {
// Don't consider deprecations in certain cases:
var _a;
const services = experimental_utils_1.ESLintUtils.getParserServices(context);
// Don't consider deprecations in certain cases:
// - On JSX closing elements (only flag the opening element)
const isClosingElement = id.type === 'JSXIdentifier' && ((_a = id.parent) === null || _a === void 0 ? void 0 : _a.type) === 'JSXClosingElement';
if (isClosingElement) {
return;
}
// - At the spot where something is declared
const isIdDeclaration = (id.type === 'Identifier' || id.type === 'JSXIdentifier') &&
isDeclaration(id, context);
if (isIdDeclaration) {
return;
}
// - Inside an import

@@ -56,10 +66,6 @@ const isInsideImport = context

.some((anc) => anc.type.includes('Import'));
// - At the spot where something is declared
const isIdDeclaration = (id.type === 'Identifier' || id.type === 'JSXIdentifier') &&
isDeclaration(id, context);
// - On JSX closing elements (only flag the opening element)
const isClosingElement = id.type === 'JSXIdentifier' && ((_a = id.parent) === null || _a === void 0 ? void 0 : _a.type) === 'JSXClosingElement';
if (isInsideImport || isIdDeclaration || isClosingElement) {
if (isInsideImport) {
return;
}
const services = experimental_utils_1.ESLintUtils.getParserServices(context);
const deprecation = getDeprecation(id, services, context);

@@ -66,0 +72,0 @@ if (deprecation) {

{
"name": "eslint-plugin-deprecation",
"version": "1.3.2",
"version": "1.3.3",
"description": "ESLint rule that reports usage of deprecated code",

@@ -5,0 +5,0 @@ "author": "Alex Malkevich <malkevich.alex@gmail.com>",

Sorry, the diff of this file is not supported yet

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