@arcgis/eslint-config 5.2.0-next.71 → 5.2.0-next.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Licensing
2
2
 
3
- COPYRIGHT © Esri
3
+ COPYRIGHT Esri
4
4
 
5
5
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
6
 
7
- This material is licensed for use under the [Esri Master License Agreement (MLA)](https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf), and is bound by the terms of that agreement.
7
+ This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement.
8
8
  You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
9
9
 
10
+ See use restrictions at https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf.
11
+
10
12
  For additional information, contact:
11
13
  Environmental Systems Research Institute, Inc.
12
14
  Attn: Contracts and Legal Services Department
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- const version = "5.2.0-next.71";
2
+ const version = "5.2.0-next.73";
3
3
  const packageJson = {
4
4
  version
5
5
  };
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-BWNbIFsm.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-KXkv-yZr.js";
2
2
  import { AST_NODE_TYPES, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import { generateDifferences, showInvisibles } from "prettier-linter-helpers";
4
4
  import path, { relative, win32, posix, normalize } from "path";
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-BWNbIFsm.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-KXkv-yZr.js";
2
2
  import { AST_NODE_TYPES, ESLintUtils, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import { l as luminaJsxExportName, a as luminaEntrypointName, b as luminaTestEntrypointName, s as sourceCodeDeclaresComponent, p as parsePropertyDecorator, c as getProperty, i as isGetterWithoutSetter, e as extractDeclareElementsInterface, d as isCreateEvent, h as hasDecorator, f as getName, j as checkForLuminaJsx, k as isBindThisCallee, g as getComponentDeclaration, u as unwrapExpression } from "../../estree-CDc-die8.js";
4
4
  import ts from "typescript";
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-BWNbIFsm.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-KXkv-yZr.js";
2
2
  import { TSESTree, AST_TOKEN_TYPES, AST_NODE_TYPES, TSESLint } from "@typescript-eslint/utils";
3
3
  import path from "node:path";
4
4
  import { resolve } from "path/posix";
@@ -666,8 +666,23 @@ function isAllowedIdentifier(name, scope, options) {
666
666
  if (builtInTypes.has(name) && isUnshadowedBuiltIn(variable)) {
667
667
  return true;
668
668
  }
669
+ if (isImportVariable(variable) && hasValueReferenceOutsideInstanceOf(variable)) {
670
+ return true;
671
+ }
669
672
  return isClassVariable(variable);
670
673
  }
674
+ function isImportVariable(variable) {
675
+ return variable?.defs.some((definition) => definition.type === TSESLint.Scope.DefinitionType.ImportBinding) ?? false;
676
+ }
677
+ function hasValueReferenceOutsideInstanceOf(variable) {
678
+ return variable.references.some(
679
+ (reference) => reference.isValueReference && reference.identifier.type === AST_NODE_TYPES.Identifier && !isInstanceOfRightOperand(reference.identifier)
680
+ );
681
+ }
682
+ function isInstanceOfRightOperand(identifier) {
683
+ const parent = identifier.parent;
684
+ return parent.type === AST_NODE_TYPES.BinaryExpression && parent.operator === "instanceof" && parent.right === identifier;
685
+ }
671
686
  function isUnshadowedBuiltIn(variable) {
672
687
  if (!variable) {
673
688
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "5.2.0-next.71",
3
+ "version": "5.2.0-next.73",
4
4
  "description": "ESLint configuration for WebGIS SDK",
5
5
  "type": "module",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "tslib": "^2.8.1",
42
42
  "typescript": "~6.0.3",
43
43
  "typescript-eslint": "^8.63.0",
44
- "@arcgis/toolkit": "5.2.0-next.71"
44
+ "@arcgis/toolkit": "5.2.0-next.73"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "eslint": "^10.6.0"