pasika 0.10.67 → 0.10.68
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/eslint/pasika/index.js +24 -6
- package/package.json +1 -1
|
@@ -301,6 +301,15 @@ function propertyName(node) {
|
|
|
301
301
|
if (ts.isIdentifier(node) || ts.isStringLiteral(node) || ts.isNumericLiteral(node)) return node.text;
|
|
302
302
|
return void 0;
|
|
303
303
|
}
|
|
304
|
+
function bindingIdentifiers(name) {
|
|
305
|
+
if (ts.isIdentifier(name)) return [name];
|
|
306
|
+
const identifiers = [];
|
|
307
|
+
for (const element of name.elements) {
|
|
308
|
+
if (ts.isOmittedExpression(element)) continue;
|
|
309
|
+
identifiers.push(...bindingIdentifiers(element.name));
|
|
310
|
+
}
|
|
311
|
+
return identifiers;
|
|
312
|
+
}
|
|
304
313
|
function returnsJsx(node) {
|
|
305
314
|
let found = false;
|
|
306
315
|
const visit = (child) => {
|
|
@@ -417,12 +426,21 @@ function parseModule(file) {
|
|
|
417
426
|
}
|
|
418
427
|
if (ts.isVariableStatement(statement)) {
|
|
419
428
|
for (const declaration of statement.declarationList.declarations) {
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
429
|
+
if (ts.isIdentifier(declaration.name)) {
|
|
430
|
+
exports.push({
|
|
431
|
+
name: declaration.name.text,
|
|
432
|
+
kind: classifyValue(declaration.name.text, declaration.initializer, isTsx),
|
|
433
|
+
line: lineOf(sourceFile, declaration)
|
|
434
|
+
});
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
for (const identifier of bindingIdentifiers(declaration.name)) {
|
|
438
|
+
exports.push({
|
|
439
|
+
name: identifier.text,
|
|
440
|
+
kind: classifyValue(identifier.text, void 0, isTsx),
|
|
441
|
+
line: lineOf(sourceFile, identifier)
|
|
442
|
+
});
|
|
443
|
+
}
|
|
426
444
|
}
|
|
427
445
|
continue;
|
|
428
446
|
}
|