@typescript-eslint/eslint-plugin 8.47.1-alpha.0 → 8.47.1-alpha.2

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.
@@ -2,6 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@typescript-eslint/utils");
4
4
  const util_1 = require("../util");
5
+ const builtInArrays = new Set([
6
+ 'Float32Array',
7
+ 'Float64Array',
8
+ 'Int16Array',
9
+ 'Int32Array',
10
+ 'Int8Array',
11
+ 'Uint16Array',
12
+ 'Uint32Array',
13
+ 'Uint8Array',
14
+ 'Uint8ClampedArray',
15
+ ]);
5
16
  exports.default = (0, util_1.createRule)({
6
17
  name: 'consistent-generic-constructors',
7
18
  meta: {
@@ -40,6 +51,10 @@ exports.default = (0, util_1.createRule)({
40
51
  throw new Error(`Unhandled node type: ${node.type}`);
41
52
  }
42
53
  }
54
+ function isBuiltInArray(typeName) {
55
+ return (builtInArrays.has(typeName.name) &&
56
+ (0, util_1.isReferenceToGlobalFunction)(typeName.name, typeName, context.sourceCode));
57
+ }
43
58
  const [lhsName, rhs] = getLHSRHS();
44
59
  const lhs = lhsName.typeAnnotation?.typeAnnotation;
45
60
  if (!rhs ||
@@ -50,7 +65,8 @@ exports.default = (0, util_1.createRule)({
50
65
  if (lhs &&
51
66
  (lhs.type !== utils_1.AST_NODE_TYPES.TSTypeReference ||
52
67
  lhs.typeName.type !== utils_1.AST_NODE_TYPES.Identifier ||
53
- lhs.typeName.name !== rhs.callee.name)) {
68
+ lhs.typeName.name !== rhs.callee.name ||
69
+ isBuiltInArray(lhs.typeName))) {
54
70
  return;
55
71
  }
56
72
  if (mode === 'type-annotation') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "8.47.1-alpha.0",
3
+ "version": "8.47.1-alpha.2",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -59,10 +59,10 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@eslint-community/regexpp": "^4.10.0",
62
- "@typescript-eslint/scope-manager": "8.47.1-alpha.0",
63
- "@typescript-eslint/type-utils": "8.47.1-alpha.0",
64
- "@typescript-eslint/utils": "8.47.1-alpha.0",
65
- "@typescript-eslint/visitor-keys": "8.47.1-alpha.0",
62
+ "@typescript-eslint/scope-manager": "8.47.1-alpha.2",
63
+ "@typescript-eslint/type-utils": "8.47.1-alpha.2",
64
+ "@typescript-eslint/utils": "8.47.1-alpha.2",
65
+ "@typescript-eslint/visitor-keys": "8.47.1-alpha.2",
66
66
  "graphemer": "^1.4.0",
67
67
  "ignore": "^7.0.0",
68
68
  "natural-compare": "^1.4.0",
@@ -71,8 +71,8 @@
71
71
  "devDependencies": {
72
72
  "@types/mdast": "^4.0.3",
73
73
  "@types/natural-compare": "*",
74
- "@typescript-eslint/rule-schema-to-typescript-types": "8.47.1-alpha.0",
75
- "@typescript-eslint/rule-tester": "8.47.1-alpha.0",
74
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.47.1-alpha.2",
75
+ "@typescript-eslint/rule-tester": "8.47.1-alpha.2",
76
76
  "@vitest/coverage-v8": "^3.1.3",
77
77
  "ajv": "^6.12.6",
78
78
  "cross-fetch": "*",
@@ -92,7 +92,7 @@
92
92
  "vitest": "^3.1.3"
93
93
  },
94
94
  "peerDependencies": {
95
- "@typescript-eslint/parser": "^8.47.1-alpha.0",
95
+ "@typescript-eslint/parser": "^8.47.1-alpha.2",
96
96
  "eslint": "^8.57.0 || ^9.0.0",
97
97
  "typescript": ">=4.8.4 <6.0.0"
98
98
  },