fix glob-to-regexp d.ts - #49
Conversation
|
The issue is, that |
| @@ -1,7 +1,9 @@ | |||
| declare module "glob-to-regexp" { | |||
There was a problem hiding this comment.
Do we need to delcare module then at all? https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-function-d-ts.html looks like we should be able to declare a function and export it
There was a problem hiding this comment.
module declaration is needed if import ... from "module" syntax should stay, cf. microsoft/TypeScript#5073.
There was a problem hiding this comment.
if we use import x = require('module') then it should not be necessary
There was a problem hiding this comment.
well, it's still required.
[ts]
Could not find a declaration file for module 'glob-to-regexp'. '/Users/tugarev/Projects/monaco-languageclient/node_modules/glob-to-regexp/index.js' implicitly has an 'any' type.
Trynpm install @types/glob-to-regexpif it exists or add a new declaration (.d.ts) file containingdeclare module 'glob-to-regexp';
There was a problem hiding this comment.
I double-checked that, it's required if types should be imported, right? module-function.d.ts seems to be misleading.
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| * ------------------------------------------------------------------------------------------ */ | ||
| import globToRegExp from "glob-to-regexp"; | ||
| import * as globToRegExp from 'glob-to-regexp'; |
There was a problem hiding this comment.
import globToRegExp = require('glob-to-regexp') should be used
There was a problem hiding this comment.
should I change it?
There was a problem hiding this comment.
yes, please, I think it is bogus to use es6 syntax to import not es6 modules
Signed-off-by: Alex Tugarev <alex.tugarev@typefox.io>
18e6c3d to
d6424cd
Compare
|
@AlexTugarev I've sent you an invitation, please accept it and merge the PR |
Signed-off-by: Alex Tugarev alex.tugarev@typefox.io