@drskillissue/ganko 0.3.0 → 0.3.1
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/dist/{chunk-2VRVUMIE.js → chunk-AXFVBCJD.js} +18 -2
- package/dist/chunk-AXFVBCJD.js.map +1 -0
- package/dist/eslint-plugin.cjs +17 -1
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +1 -1
- package/dist/index.cjs +99 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +83 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2VRVUMIE.js.map +0 -1
package/dist/eslint-plugin.cjs
CHANGED
|
@@ -2999,6 +2999,7 @@ var TypeResolver = class {
|
|
|
2999
2999
|
checkPropertyOnType(tsType, propertyName) {
|
|
3000
3000
|
const property = tsType.getProperty(propertyName);
|
|
3001
3001
|
if (property !== void 0) return true;
|
|
3002
|
+
if (this.checker.getIndexTypeOfType(tsType, import_typescript2.default.IndexKind.String) !== void 0) return true;
|
|
3002
3003
|
if (tsType.isUnion()) {
|
|
3003
3004
|
for (const constituent of tsType.types) {
|
|
3004
3005
|
const flags = constituent.flags;
|
|
@@ -9275,7 +9276,22 @@ function isObjectLiteralTarget(graph, pa) {
|
|
|
9275
9276
|
const variable = getVariableByNameInScope(graph, obj.text, pa.scope);
|
|
9276
9277
|
if (!variable) return false;
|
|
9277
9278
|
const init = variable.initializer;
|
|
9278
|
-
|
|
9279
|
+
if (init === null || !import_typescript34.default.isObjectLiteralExpression(init)) return false;
|
|
9280
|
+
if (propertyExistsInLiteral(init, pa)) return false;
|
|
9281
|
+
return true;
|
|
9282
|
+
}
|
|
9283
|
+
function propertyExistsInLiteral(literal, pa) {
|
|
9284
|
+
let propName = null;
|
|
9285
|
+
if (!pa.computed && import_typescript34.default.isIdentifier(pa.property)) propName = pa.property.text;
|
|
9286
|
+
else if (import_typescript34.default.isStringLiteral(pa.property)) propName = pa.property.text;
|
|
9287
|
+
if (propName === null) return false;
|
|
9288
|
+
for (let i = 0; i < literal.properties.length; i++) {
|
|
9289
|
+
const prop = literal.properties[i];
|
|
9290
|
+
if (!prop) continue;
|
|
9291
|
+
if (import_typescript34.default.isPropertyAssignment(prop) && import_typescript34.default.isIdentifier(prop.name) && prop.name.text === propName) return true;
|
|
9292
|
+
if (import_typescript34.default.isShorthandPropertyAssignment(prop) && prop.name.text === propName) return true;
|
|
9293
|
+
}
|
|
9294
|
+
return false;
|
|
9279
9295
|
}
|
|
9280
9296
|
function getMemberAccessesOnIdentifier(fn, identifierName) {
|
|
9281
9297
|
const cache = fn._memberAccessesByIdentifier;
|