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.2.0 to 1.2.1

dist/eslint-plugin-deprecation-1.2.1.tgz

7

CHANGELOG.md
# Changelog
## [1.2.1](https://github.com/gund/eslint-plugin-deprecation/compare/v1.2.0...v1.2.1) (2021-05-04)
### Bug Fixes
* don't flag JSX closing tags ([ea60c3d](https://github.com/gund/eslint-plugin-deprecation/commit/ea60c3dd3131946f792e895816447e3e317bc73b))
# [1.2.0](https://github.com/gund/eslint-plugin-deprecation/compare/v1.1.1...v1.2.0) (2020-12-07)

@@ -4,0 +11,0 @@

16

dist/rules/deprecation.js

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

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

@@ -59,0 +63,0 @@ }

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

@@ -52,2 +52,3 @@ "author": "Alex Malkevich <malkevich.alex@gmail.com>",

"husky": "^4.2.3",
"lint-staged": "^10.5.4",
"jest": "^25.0.0",

@@ -54,0 +55,0 @@ "prettier": "^1.19.1",

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