eslint-plugin-deprecation
Advanced tools
Comparing version 1.2.0 to 1.2.1
# 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 @@ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44896
296
23