Skip to content
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

Referencing TypeScript definition files #660

Closed
krokofant opened this issue Oct 12, 2016 · 8 comments
Closed

Referencing TypeScript definition files #660

krokofant opened this issue Oct 12, 2016 · 8 comments

Comments

@krokofant
Copy link

To use definition files for libraries to provide IntelliSense is increasing.

I'd like to be able to use this as acceptable by standard
/// <reference path="jquery/index.d.ts" />

Currently I get the

Expected space or tab after '//' in com
ment.

@krokofant krokofant changed the title TypeScript definition files Referencing TypeScript definition files Oct 12, 2016
@feross
Copy link
Member

feross commented Oct 13, 2016

Can you link to the documentation where this /// is specified?

If it's sufficiently common, I'm fine adding an exception for this. We already have a few exceptions for other tooling.

@krokofant
Copy link
Author

Here is the TypeScript documentation for the /// syntax.

@yoshuawuyts
Copy link
Contributor

yoshuawuyts commented Oct 13, 2016

@feross which exceptions do you refer to? iirc in hindsight the sentiment wasn't entirely favor of non-standard additions to standard (like JSX), even though it's been a huge drive in standard's adoption

I feel that if this were to become a rule, it should be strict; e.g. only allow it for a leading comment on the first line - disabling comment validation in its entirety would probably be undesireable

@krokofant
Copy link
Author

To add more to my opinion I want to use standard as it is a simple ruleset to adhere to but it's not usable if it hinders, and provides no alternative, to something that a developer sees as necessary. Regarding the format I just want something that works. 😄

@feross
Copy link
Member

feross commented Oct 14, 2016

@yoshuawuyts You can see the list of exceptions to the spaced-comment rule here: https://github.com/feross/eslint-config-standard/blob/5eed6cd11bc77866fe719ee117918d0570e3a71c/eslintrc.json#L141

The point of spaced-comment is to prevent //my comment in favor of // my comment. The chance that a user's comment begins with a / is basically nil:

// /is this a possible legit comment?

So, IMO, we should just allow it, especially if it's a directive used by popular tools. We already allow:

//! This comment will not be removed by minifiers
/*! This comment will not be removed by minifiers */

Note, a space is still required after the //! because the ! is considered a "marker" that is part of the start of the comment string. So //!comment is still disallowed.

@yoshuawuyts
Copy link
Contributor

@feross fair point, ACK on this change

@feross feross added this to the standard v9 milestone Jan 17, 2017
@feross
Copy link
Member

feross commented Jan 17, 2017

Okay, adding this to the standard v9 milestone.

@feross
Copy link
Member

feross commented Feb 9, 2017

This will be part of standard v9. Since this relaxes a rule, there is no ecosystem impact.

@feross feross closed this as completed Feb 9, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

3 participants