diff --git a/ets2panda/linter/lib/TypeScriptLinter.ts b/ets2panda/linter/lib/TypeScriptLinter.ts index 2ee4cc4bbbb1466885156d60cec6f5d2a1fd97ee..2bd288078527af19cebbda349d212d98f8c16cfa 100644 --- a/ets2panda/linter/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/lib/TypeScriptLinter.ts @@ -2489,13 +2489,13 @@ export class TypeScriptLinter { case ts.SyntaxKind.InterfaceDeclaration: case ts.SyntaxKind.ClassDeclaration: if (!this.tsUtils.isShareableType(this.tsTypeChecker.getTypeAtLocation(parentNode))) { - this.incrementCounters((parentNode as ts.NamedDeclaration).name ?? parentNode, FaultID.SharedModuleExports); + this.incrementCounters(parentNode, FaultID.SharedModuleExports); } return; case ts.SyntaxKind.VariableStatement: for (const variableDeclaration of (parentNode as ts.VariableStatement).declarationList.declarations) { if (!this.tsUtils.isShareableEntity(variableDeclaration.name)) { - this.incrementCounters(variableDeclaration.name, FaultID.SharedModuleExports); + this.incrementCounters(variableDeclaration, FaultID.SharedModuleExports); } } return; diff --git a/ets2panda/linter/test/shared_module.ts.json b/ets2panda/linter/test/shared_module.ts.json index b3b74291dc65a33786c56f1418ea8699a5210346..fa18e4c1450350c13eaa20174189d59c5d1c45fa 100644 --- a/ets2panda/linter/test/shared_module.ts.json +++ b/ets2panda/linter/test/shared_module.ts.json @@ -16,93 +16,80 @@ "nodes": [ { "line": 21, - "column": 13, + "column": 1, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 23, "column": 12, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 25, - "column": 14, + "column": 1, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 28, "column": 12, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 30, - "column": 18, + "column": 1, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 35, "column": 9, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 38, "column": 9, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 41, "column": 13, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 42, "column": 1, "problem": "SharedModuleNoWildcardExport", - "suggest": "", "rule": "\"export * from ...\" is not allowed in shared module (arkts-shared-module-no-wildcard-export)" }, { "line": 45, "column": 14, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 46, "column": 12, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 47, "column": 12, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" }, { "line": 57, "column": 9, "problem": "SharedModuleExports", - "suggest": "", "rule": "Only \"Sendable\" entities can be exported in shared module (arkts-shared-module-exports)" } ]