-
-
Notifications
You must be signed in to change notification settings - Fork 200
fix glob-to-regexp d.ts #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The issue is, that |
@@ -1,7 +1,9 @@ | |||
declare module "glob-to-regexp" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module declaration is needed if import ... from "module"
syntax should stay, cf. microsoft/TypeScript#5073.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we use import x = require('module')
then it should not be necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-regexp
if it exists or add a new declaration (.d.ts) file containingdeclare module 'glob-to-regexp';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double-checked that, it's required if types should be imported, right? module-function.d.ts seems to be misleading.
src/languages.ts
Outdated
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import globToRegExp = require('glob-to-regexp')
should be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please, I think it is bogus to use es6 syntax to import not es6 modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Alex Tugarev <[email protected]>
18e6c3d
to
d6424cd
Compare
@AlexTugarev I've sent you an invitation, please accept it and merge the PR |
Signed-off-by: Alex Tugarev [email protected]