I'm encountering multiple TS errors from leaflet and leaflet-editable @types that are all showing the same error but pointing to different lines in the type definition files:
TS2451: Cannot redeclare block-scoped variable 'L'.
My project is built in AMD format and loaded with requireJS.
This is my tsconfig setup:
{
"compilerOptions": {
"target": "es5",
"sourceMap": true,
"outDir": "./dist",
"rootDir": "../",
"noImplicitAny": false,
"noImplicitThis": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"pretty": true,
"removeComments": false,
"allowUnreachableCode": false,
"declaration": false,
"allowJs": true,
"module": "amd",
"typeRoots" : ["./typings/index.d.ts", "../../node_modules/@types"],
"skipLibCheck": true,
"allowSyntheticDefaultImports": true
},
"include": [
"./typings/index.d.ts",
"./globals.d.ts",
"./app/**/*.module.ts",
"./app/**/*.run.ts",
"./app/**/*.routes.ts",
"./app/**/*.enum.ts",
"./app/**/*.controller.ts",
"./app/**/*.model.ts",
"./app/**/*.directive.ts",
"./app/**/*.component.ts",
"./app/**/*.filter.ts",
"./app/**/*.service.ts",
"./app/interfaces/**/*.ts"
],
"exclude": [
"dist",
"node_modules"
]
}
Although my application works as expected in the browser, I'm unsure how to resolve this error.
If anyone has any insights, I'd greatly appreciate it! Thanks