mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Provide better error message
This commit is contained in:
@@ -479,6 +479,9 @@ namespace ts {
|
||||
}
|
||||
recordMergedSymbol(target, source);
|
||||
}
|
||||
else if (target.flags & SymbolFlags.NamespaceModule) {
|
||||
error(source.valueDeclaration.name, Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
|
||||
}
|
||||
else {
|
||||
const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
|
||||
? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;
|
||||
|
||||
@@ -1807,6 +1807,10 @@
|
||||
"category": "Error",
|
||||
"code": 2608
|
||||
},
|
||||
"Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": {
|
||||
"category": "Error",
|
||||
"code": 2649
|
||||
},
|
||||
"Cannot emit namespaced JSX elements in React": {
|
||||
"category": "Error",
|
||||
"code": 2650
|
||||
|
||||
@@ -1,22 +1,16 @@
|
||||
/node_modules/@types/lib-extender/index.d.ts(2,16): error TS2300: Duplicate identifier '"lib"'.
|
||||
/node_modules/lib/index.d.ts(1,13): error TS2300: Duplicate identifier '"lib"'.
|
||||
/node_modules/lib/index.d.ts(2,19): error TS2300: Duplicate identifier '"lib"'.
|
||||
/node_modules/@types/lib-extender/index.d.ts(2,16): error TS2649: Cannot augment module 'lib' with value exports because it resolves to a non-module entity.
|
||||
|
||||
|
||||
==== /node_modules/lib/index.d.ts (2 errors) ====
|
||||
==== /node_modules/lib/index.d.ts (0 errors) ====
|
||||
declare var lib: () => void;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"lib"'.
|
||||
declare namespace lib {}
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"lib"'.
|
||||
export = lib;
|
||||
|
||||
==== /node_modules/@types/lib-extender/index.d.ts (1 errors) ====
|
||||
import * as lib from "lib";
|
||||
declare module "lib" {
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"lib"'.
|
||||
!!! error TS2649: Cannot augment module 'lib' with value exports because it resolves to a non-module entity.
|
||||
export function fn(): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user